diff options
Diffstat (limited to 'vendor/code.gitea.io/git/tree.go')
-rw-r--r-- | vendor/code.gitea.io/git/tree.go | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/vendor/code.gitea.io/git/tree.go b/vendor/code.gitea.io/git/tree.go index 4654dac30e..b67bf55840 100644 --- a/vendor/code.gitea.io/git/tree.go +++ b/vendor/code.gitea.io/git/tree.go @@ -70,3 +70,17 @@ func (t *Tree) ListEntries() (Entries, error) { t.entries, err = parseTreeEntries(stdout, t) return t.entries, err } + +// ListEntriesRecursive returns all entries of current tree recursively including all subtrees +func (t *Tree) ListEntriesRecursive() (Entries, error) { + if t.entriesParsed { + return t.entries, nil + } + stdout, err := NewCommand("ls-tree", "-t", "-r", t.ID.String()).RunInDirBytes(t.repo.Path) + + if err != nil { + return nil, err + } + t.entries, err = parseTreeEntries(stdout, t) + return t.entries, err +} |