Skip to content

Find, verify, and analyze leaked credentials

Move commits_scanned to ScanRepo (#1610)

Bill Rich2d2595a2e36c
diff --git a/pkg/sources/git/git.go b/pkg/sources/git/git.go
index e6ce07376..16a2e64d3 100644
--- a/pkg/sources/git/git.go
+++ b/pkg/sources/git/git.go
@@ -163,7 +163,7 @@ func (s *Source) Chunks(ctx context.Context, chunksChan chan *sources.Chunk) err
}
totalRepos := len(s.conn.Repositories) + len(s.conn.Directories)
- ctx.Logger().V(1).Info("Git source finished scanning", "repo_count", totalRepos, "commits_scanned", atomic.LoadUint64(&s.git.metrics.commitsScanned))
+ ctx.Logger().V(1).Info("Git source finished scanning", "repo_count", totalRepos)
s.SetProgressComplete(
totalRepos, totalRepos,
fmt.Sprintf("Completed scanning source %s", s.name), "",
@@ -640,7 +640,7 @@ func (s *Git) ScanRepo(ctx context.Context, repo *git.Repository, repoPath strin
}
scanTime := time.Now().Unix() - start
- ctx.Logger().V(1).Info("scanning git repo complete", "repo", repoUrl, "path", repoPath, "time_seconds", scanTime)
+ ctx.Logger().V(1).Info("scanning git repo complete", "repo", repoUrl, "path", repoPath, "time_seconds", scanTime, "commits_scanned", atomic.LoadUint64(&s.metrics.commitsScanned))
return nil
}