Fix #6813: Allow git.GetTree to take both commit and tree names (#6816)

* Allow git.GetTree to take both commit and tree names, return full paths on entries listed through Tree.ListEntriesRecursive

Signed-off-by: Filip Navara <filip.navara@gmail.com>

* Fix the SHA returned on Git Tree APIs called with commit hash or symbolic name

Signed-off-by: Filip Navara <filip.navara@gmail.com>
This commit is contained in:
Filip Navara 2019-05-03 02:33:11 +02:00 committed by techknowlogick
parent a27d5d2b23
commit dbb0c9658c
4 changed files with 18 additions and 12 deletions

View file

@ -40,12 +40,16 @@ type TreeEntry struct {
gogitTreeEntry *object.TreeEntry
ptree *Tree
size int64
sized bool
size int64
sized bool
fullName string
}
// Name returns the name of the entry
func (te *TreeEntry) Name() string {
if te.fullName != "" {
return te.fullName
}
return te.gogitTreeEntry.Name
}