knotserver: detect bun.lock files as generated #576

merged
opened by oppi.li targeting master from push-xvrvnuvsmslv

this is a patch fix, the real fix would be to add this to go-enry's list of generated file names.

Signed-off-by: oppiliappan me@oppi.li

Changed files
+4 -1
knotserver
+4 -1
knotserver/git/language.go
···
import (
"context"
"path"
+
"strings"
"github.com/go-enry/go-enry/v2"
"github.com/go-git/go-git/v5/plumbing/object"
···
return nil
}
-
if enry.IsGenerated(filepath, content) {
+
if enry.IsGenerated(filepath, content) ||
+
enry.IsBinary(content) ||
+
strings.HasSuffix(filepath, "bun.lock") {
return nil
}