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:
@@ -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)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user