From 79c3f99165d0175dcd90bd48a7ec066a5300dfa7 Mon Sep 17 00:00:00 2001 From: zach rice Date: Wed, 6 Feb 2019 19:48:17 -0600 Subject: [PATCH] fixing tests --- gitleaks_test.go | 16 ++++++++++++++++ main.go | 2 -- 2 files changed, 16 insertions(+), 2 deletions(-) diff --git a/gitleaks_test.go b/gitleaks_test.go index b5acfde1..4ab41080 100644 --- a/gitleaks_test.go +++ b/gitleaks_test.go @@ -560,6 +560,22 @@ func TestAuditRepo(t *testing.T) { }, numLeaks: 2, }, + { + repo: leaksRepo, + description: "Audit a specific commit", + numLeaks: 1, + testOpts: Options{ + Commit: "cb5599aeed261b2c038aa4729e2d53ca050a4988", + }, + }, + { + repo: leaksRepo, + description: "Audit a specific commit no leaks", + numLeaks: 0, + testOpts: Options{ + Commit: "2b033e012eee364fc41b4ab7c5db1497399b8e67", + }, + }, { repo: leaksRepo, description: "toml whitelist regex", diff --git a/main.go b/main.go index b7087483..3d4ab359 100644 --- a/main.go +++ b/main.go @@ -489,7 +489,6 @@ func auditGitRepo(repo *RepoDescriptor) ([]Leak, error) { return leaks, err } err = refs.ForEach(func(ref *plumbing.Reference) error { - fmt.Println(ref.Name()) if ref.Name().IsTag() { return nil } @@ -556,7 +555,6 @@ func auditGitReference(repo *RepoDescriptor, ref *plumbing.Reference) []Leak { cMutex.Lock() commitMap[c.Hash.String()] = true cMutex.Unlock() - fmt.Println(c.Hash.String()) totalCommits = totalCommits + 1 fIter, err := c.Files()