1
0
mirror of https://github.com/go-gitea/git.git synced 2026-02-05 06:45:03 +01:00

add last commit cache interface (#144)

* add last commit cache interface

* fix tests
This commit is contained in:
Lunny Xiao
2019-02-12 19:00:42 +08:00
committed by GitHub
parent 0aea7f12d3
commit 2fa2b63334
3 changed files with 28 additions and 7 deletions

View File

@@ -51,7 +51,7 @@ func testGetCommitsInfo(t *testing.T, repo1 *Repository) {
assert.NoError(t, err)
entries, err := tree.ListEntries()
assert.NoError(t, err)
commitsInfo, err := entries.GetCommitsInfo(commit, testCase.Path)
commitsInfo, err := entries.GetCommitsInfo(commit, testCase.Path, nil)
assert.NoError(t, err)
assert.Len(t, commitsInfo, len(testCase.ExpectedIDs))
for _, commitInfo := range commitsInfo {
@@ -106,7 +106,7 @@ func BenchmarkEntries_GetCommitsInfo(b *testing.B) {
b.ResetTimer()
b.Run(benchmark.name, func(b *testing.B) {
for i := 0; i < b.N; i++ {
_, err := entries.GetCommitsInfo(commit, "")
_, err := entries.GetCommitsInfo(commit, "", nil)
if err != nil {
b.Fatal(err)
}