aboutsummaryrefslogtreecommitdiff
path: root/lib/git
diff options
context:
space:
mode:
Diffstat (limited to 'lib/git')
-rw-r--r--lib/git/git_test.go11
-rw-r--r--lib/git/testdata/IsIgnored/a/b/.gitignore2
2 files changed, 7 insertions, 6 deletions
diff --git a/lib/git/git_test.go b/lib/git/git_test.go
index f67fa1aa..7462ef1d 100644
--- a/lib/git/git_test.go
+++ b/lib/git/git_test.go
@@ -206,12 +206,6 @@ func TestGit_LogFollow(t *testing.T) {
}{{
path: `lib/_hunspell/affix.go`,
exp: []string{
- `144549f8,1737804887,Shulhan,ms@kilabit.info,lib/hunspell: rename the package to "_hunspell"`,
- `66e6542e,1694357806,Shulhan,ms@kilabit.info,lib/hunspell: realign struct for better size allocation`,
- `0c9abc1a,1652108042,Shulhan,ms@kilabit.info,all: reformat all codes using gofmt 1.19 (the Go tip)`,
- `9ca9757d,1591803682,Shulhan,m.shulhan@gmail.com,all: update email address`,
- `b0fa5a47,1585156612,Shulhan,m.shulhan@gmail.com,all: fix and suppress linter warnings`,
- `33d58b98,1585151378,Shulhan,m.shulhan@gmail.com,hunspell: add field Parent to Stem`,
`367e15a8,1585139124,Shulhan,m.shulhan@gmail.com,hunspell: change the stem.apply parameter from string to *Stem`,
`099a24de,1579628651,Shulhan,m.shulhan@gmail.com,hunspell: split the affix options and dictionary into different types`,
`3d772dff,1572967023,Shulhan,m.shulhan@gmail.com,lib/hunspell: implementation of hunspell in pure Go`,
@@ -231,6 +225,11 @@ func TestGit_LogFollow(t *testing.T) {
test.Assert(t, tc.path+` error`, tc.expError, err.Error())
continue
}
+ if len(logs) > 3 {
+ // Compare only the last 3 commits, since the file
+ // history may changes in the future.
+ logs = logs[len(logs)-3:]
+ }
test.Assert(t, tc.path, tc.exp, logs)
}
}
diff --git a/lib/git/testdata/IsIgnored/a/b/.gitignore b/lib/git/testdata/IsIgnored/a/b/.gitignore
index 120f485d..6cf38aa5 100644
--- a/lib/git/testdata/IsIgnored/a/b/.gitignore
+++ b/lib/git/testdata/IsIgnored/a/b/.gitignore
@@ -1,2 +1,4 @@
+# SPDX-License-Identifier: BSD-3-Clause
+# SPDX-FileCopyrightText: 2026 M. Shulhan <ms@kilabit.info>
*
!/.gitignore