Skip to content

Commit 7ba7a00

Browse files
authored
Fix "skipping binary file" logging to show actual file name (#4509)
This was intended to show path:fileName, but `path` in these scopes is the repo path, not a file. This section was moved in a refactor where `path` was the file in the old scope, and since both scopes have `path string`, it was not flagged and easy to miss.
1 parent 7d61a4b commit 7ba7a00

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

pkg/sources/git/git.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -768,7 +768,7 @@ func (s *Git) ScanCommits(ctx context.Context, repo *git.Repository, path string
768768
if s.skipBinaries || feature.ForceSkipBinaries.Load() {
769769
logger.V(5).Info("skipping binary file",
770770
"commit", commitHash.String()[:7],
771-
"path", path)
771+
"path", fileName)
772772
continue
773773
}
774774

@@ -999,7 +999,7 @@ func (s *Git) ScanStaged(ctx context.Context, repo *git.Repository, path string,
999999
if s.skipBinaries || feature.ForceSkipBinaries.Load() {
10001000
logger.V(5).Info("skipping binary file",
10011001
"commit", commitHash.String()[:7],
1002-
"path", path)
1002+
"path", fileName)
10031003
continue
10041004
}
10051005

0 commit comments

Comments
 (0)