aboutsummaryrefslogtreecommitdiffstats
path: root/repository_test.go
diff options
context:
space:
mode:
authorSaeed Rasooli <saeed.gnu@gmail.com>2019-11-29 13:25:05 +0330
committerSaeed Rasooli <saeed.gnu@gmail.com>2019-11-29 16:46:43 +0330
commitf54ee6d2b1f92d67ed567027f7a8ec1f2139c532 (patch)
tree588e34921a0dd445455fb709ea171c4d6b5ad445 /repository_test.go
parent1a7db85bca7027d90afdb5ce711622aaac9feaed (diff)
downloadgo-git-f54ee6d2b1f92d67ed567027f7a8ec1f2139c532.tar.gz
add NewCommitPathIterFromIter that accepts pathFilter func(string) bool
keep NewCommitFileIterFromIter for compatibilty for now Signed-off-by: Saeed Rasooli <saeed.gnu@gmail.com>
Diffstat (limited to 'repository_test.go')
-rw-r--r--repository_test.go11
1 files changed, 7 insertions, 4 deletions
diff --git a/repository_test.go b/repository_test.go
index e85311f..f9e3ca4 100644
--- a/repository_test.go
+++ b/repository_test.go
@@ -1667,7 +1667,10 @@ func (m *mockErrCommitIter) Close() {}
func (s *RepositorySuite) TestLogFileWithError(c *C) {
fileName := "README"
- cIter := object.NewCommitFileIterFromIter(fileName, &mockErrCommitIter{}, false)
+ pathIter := func(path string) bool {
+ return path == fileName
+ }
+ cIter := object.NewCommitPathIterFromIter(pathIter, &mockErrCommitIter{}, false)
defer cIter.Close()
err := cIter.ForEach(func(commit *object.Commit) error {
@@ -2615,9 +2618,9 @@ func (s *RepositorySuite) TestResolveRevisionWithErrors(c *C) {
c.Assert(err, IsNil)
datas := map[string]string{
- "efs/heads/master~": "reference not found",
- "HEAD^3": `Revision invalid : "3" found must be 0, 1 or 2 after "^"`,
- "HEAD^{/whatever}": `No commit message match regexp : "whatever"`,
+ "efs/heads/master~": "reference not found",
+ "HEAD^3": `Revision invalid : "3" found must be 0, 1 or 2 after "^"`,
+ "HEAD^{/whatever}": `No commit message match regexp : "whatever"`,
"4e1243bd22c66e76c2ba9eddc1f91394e57f9f83": "reference not found",
}