From dbb0c9658c637bb987ec7d09a43be5ace5ac6708 Mon Sep 17 00:00:00 2001 From: Filip Navara Date: Fri, 3 May 2019 02:33:11 +0200 Subject: 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 * Fix the SHA returned on Git Tree APIs called with commit hash or symbolic name Signed-off-by: Filip Navara --- modules/repofiles/tree.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'modules/repofiles') 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 { -- cgit v1.2.3