zach rice 6 лет назад
Родитель
Сommit
d2d68a7e44
2 измененных файлов с 11 добавлено и 5 удалено
  1. 4 0
      CHANGELOG.md
  2. 7 5
      src/repo.go

+ 4 - 0
CHANGELOG.md

@@ -1,5 +1,9 @@
 CHANGELOG
 CHANGELOG
 =========
 =========
+1.25.1
+----
+- Fixing #188
+
 1.25.0
 1.25.0
 ----
 ----
 - Pretty big refactor, see `src` directory
 - Pretty big refactor, see `src` directory

+ 7 - 5
src/repo.go

@@ -181,11 +181,10 @@ func (repoInfo *RepoInfo) audit() ([]Leak, error) {
 			return nil
 			return nil
 		}
 		}
 
 
-		commitCount = commitCount + 1
-		totalCommits = totalCommits + 1
-
 		// commits w/o parent (root of git the git ref) or option for single commit is not empty str
 		// commits w/o parent (root of git the git ref) or option for single commit is not empty str
-		if len(c.ParentHashes) == 0 || opts.Commit == c.Hash.String() {
+		if (len(c.ParentHashes) == 0 && opts.Commit == "") || (len(c.ParentHashes) == 0 && opts.Commit == c.Hash.String()) {
+			commitCount = commitCount + 1
+			totalCommits = totalCommits + 1
 			leaksFromSingleCommit := repoInfo.auditSingleCommit(c)
 			leaksFromSingleCommit := repoInfo.auditSingleCommit(c)
 			mutex.Lock()
 			mutex.Lock()
 			leaks = append(leaksFromSingleCommit, leaks...)
 			leaks = append(leaksFromSingleCommit, leaks...)
@@ -196,10 +195,13 @@ func (repoInfo *RepoInfo) audit() ([]Leak, error) {
 			return nil
 			return nil
 		}
 		}
 
 
-		if opts.Commit != "" {
+		if opts.Commit != "" && opts.Commit != c.Hash.String() {
 			return nil
 			return nil
 		}
 		}
 
 
+		commitCount = commitCount + 1
+		totalCommits = totalCommits + 1
+
 		// regular commit audit
 		// regular commit audit
 		err = c.Parents().ForEach(func(parent *object.Commit) error {
 		err = c.Parents().ForEach(func(parent *object.Commit) error {
 			commitWg.Add(1)
 			commitWg.Add(1)