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
··· 3 import ( 4 "context" 5 "path" 6 7 "github.com/go-enry/go-enry/v2" 8 "github.com/go-git/go-git/v5/plumbing/object" ··· 20 return nil 21 } 22 23 - if enry.IsGenerated(filepath, content) { 24 return nil 25 } 26
··· 3 import ( 4 "context" 5 "path" 6 + "strings" 7 8 "github.com/go-enry/go-enry/v2" 9 "github.com/go-git/go-git/v5/plumbing/object" ··· 21 return nil 22 } 23 24 + if enry.IsGenerated(filepath, content) || 25 + enry.IsBinary(content) || 26 + strings.HasSuffix(filepath, "bun.lock") { 27 return nil 28 } 29