diff options
author | Alberto Cortés <alberto@sourced.tech> | 2015-12-11 17:57:10 +0100 |
---|---|---|
committer | Alberto Cortés <alberto@sourced.tech> | 2015-12-11 17:57:10 +0100 |
commit | c347e978b52212b5aa968a14d81c8fff47ab24d7 (patch) | |
tree | a558263e31121ff3c7defbf5ee3d38b7a18527c9 /revlist/revlist.go | |
parent | 48bf5bdeb9092ee5004014c0bf7a21f0e2fbf6fc (diff) | |
download | go-git-c347e978b52212b5aa968a14d81c8fff47ab24d7.tar.gz |
Extra fixes for #7
Diffstat (limited to 'revlist/revlist.go')
-rw-r--r-- | revlist/revlist.go | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/revlist/revlist.go b/revlist/revlist.go index 181e56d..bbc7e1f 100644 --- a/revlist/revlist.go +++ b/revlist/revlist.go @@ -175,10 +175,12 @@ func blobHash(path string, commit *git.Commit) (hash core.Hash, found bool) { return file.Hash, true } +type contentsComparatorFn func(path string, a, b *git.Commit) (bool, error) + // Returns a new slice of commits, with duplicates removed. Expects a // sorted commit list. Duplication is defined according to "comp". It // will always keep the first commit of a series of duplicated commits. -func removeComp(path string, cs []*git.Commit, comp func(string, *git.Commit, *git.Commit) (bool, error)) ([]*git.Commit, error) { +func removeComp(path string, cs []*git.Commit, comp contentsComparatorFn) ([]*git.Commit, error) { result := make([]*git.Commit, 0, len(cs)) if len(cs) == 0 { return result, nil @@ -196,7 +198,7 @@ func removeComp(path string, cs []*git.Commit, comp func(string, *git.Commit, *g return result, nil } -// Equivalent commits are commits whos patch is the same. +// Equivalent commits are commits whose patch is the same. func equivalent(path string, a, b *git.Commit) (bool, error) { numParentsA := a.NumParents() numParentsB := b.NumParents() |