mirror of
https://github.com/go-gitea/gitea
synced 2024-10-12 16:09:15 +02:00
some fixes
This commit is contained in:
parent
c7359599c7
commit
b4306dec58
@ -7,6 +7,7 @@
|
|||||||
package git
|
package git
|
||||||
|
|
||||||
import (
|
import (
|
||||||
|
"context"
|
||||||
"io"
|
"io"
|
||||||
|
|
||||||
"github.com/go-git/go-git/v5/plumbing"
|
"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
|
// 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 {
|
if t.gogitTree == nil {
|
||||||
err := t.loadTreeObject()
|
err := t.loadTreeObject()
|
||||||
if err != nil {
|
if err != nil {
|
||||||
@ -93,6 +94,6 @@ func (t *Tree) ListEntriesRecursiveWithSize() (Entries, error) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// ListEntriesRecursiveFast is the alias of ListEntriesRecursiveWithSize for the gogit version
|
// ListEntriesRecursiveFast is the alias of ListEntriesRecursiveWithSize for the gogit version
|
||||||
func (t *Tree) ListEntriesRecursiveFast() (Entries, error) {
|
func (t *Tree) ListEntriesRecursiveFast(ctx context.Context) (Entries, error) {
|
||||||
return t.ListEntriesRecursiveWithSize()
|
return t.ListEntriesRecursiveWithSize(ctx)
|
||||||
}
|
}
|
||||||
|
@ -105,9 +105,6 @@ func (t *Tree) listEntriesRecursive(ctx context.Context, extraArgs TrustedCmdArg
|
|||||||
t.entriesRecursive = append(t.entriesRecursive, entry)
|
t.entriesRecursive = append(t.entriesRecursive, entry)
|
||||||
return nil
|
return nil
|
||||||
}, extraArgs)
|
}, extraArgs)
|
||||||
if err == nil {
|
|
||||||
t.entriesRecursiveParsed = true
|
|
||||||
}
|
|
||||||
return t.entriesRecursive, err
|
return t.entriesRecursive, err
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user