summaryrefslogtreecommitdiffstats
path: root/modules/repofiles/tree.go
diff options
context:
space:
mode:
authorFilip Navara <filip.navara@gmail.com>2019-05-03 02:33:11 +0200
committertechknowlogick <techknowlogick@gitea.io>2019-05-02 20:33:11 -0400
commitdbb0c9658c637bb987ec7d09a43be5ace5ac6708 (patch)
treed96905eee793b8bd323f942db7b5f361177221b6 /modules/repofiles/tree.go
parenta27d5d2b230e7b63a4b1959991d8b638527f48c6 (diff)
downloadgitea-dbb0c9658c637bb987ec7d09a43be5ace5ac6708.tar.gz
gitea-dbb0c9658c637bb987ec7d09a43be5ace5ac6708.zip
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>
Diffstat (limited to 'modules/repofiles/tree.go')
-rw-r--r--modules/repofiles/tree.go2
1 files changed, 1 insertions, 1 deletions
diff --git a/modules/repofiles/tree.go b/modules/repofiles/tree.go
index 5b4e7aeb28..e189fe1229 100644
--- a/modules/repofiles/tree.go
+++ b/modules/repofiles/tree.go
@@ -23,7 +23,7 @@ func GetTreeBySHA(repo *models.Repository, sha string, page, perPage int, recurs
}
}
tree := new(api.GitTreeResponse)
- tree.SHA = gitTree.CommitID.String()
+ tree.SHA = gitTree.ResolvedID.String()
tree.URL = repo.APIURL() + "/git/trees/" + tree.SHA
var entries git.Entries
if recursive {