From b4306dec5823526f3b4df0f0cb9db79da9a3dc63 Mon Sep 17 00:00:00 2001 From: Lunny Xiao Date: Sat, 25 May 2024 17:27:29 +0800 Subject: [PATCH] some fixes --- modules/git/tree_gogit.go | 7 ++++--- modules/git/tree_nogogit.go | 3 --- 2 files changed, 4 insertions(+), 6 deletions(-) diff --git a/modules/git/tree_gogit.go b/modules/git/tree_gogit.go index 421b0ecb0f..bb32df4e2e 100644 --- a/modules/git/tree_gogit.go +++ b/modules/git/tree_gogit.go @@ -7,6 +7,7 @@ package git import ( + "context" "io" "github.com/go-git/go-git/v5/plumbing" @@ -57,7 +58,7 @@ func (t *Tree) ListEntries() (Entries, error) { } // ListEntriesRecursiveWithSize returns all entries of current tree recursively including all subtrees -func (t *Tree) ListEntriesRecursiveWithSize() (Entries, error) { +func (t *Tree) ListEntriesRecursiveWithSize(ctx context.Context) (Entries, error) { if t.gogitTree == nil { err := t.loadTreeObject() if err != nil { @@ -93,6 +94,6 @@ func (t *Tree) ListEntriesRecursiveWithSize() (Entries, error) { } // ListEntriesRecursiveFast is the alias of ListEntriesRecursiveWithSize for the gogit version -func (t *Tree) ListEntriesRecursiveFast() (Entries, error) { - return t.ListEntriesRecursiveWithSize() +func (t *Tree) ListEntriesRecursiveFast(ctx context.Context) (Entries, error) { + return t.ListEntriesRecursiveWithSize(ctx) } diff --git a/modules/git/tree_nogogit.go b/modules/git/tree_nogogit.go index 84283f73ed..303666413a 100644 --- a/modules/git/tree_nogogit.go +++ b/modules/git/tree_nogogit.go @@ -105,9 +105,6 @@ func (t *Tree) listEntriesRecursive(ctx context.Context, extraArgs TrustedCmdArg t.entriesRecursive = append(t.entriesRecursive, entry) return nil }, extraArgs) - if err == nil { - t.entriesRecursiveParsed = true - } return t.entriesRecursive, err }