diff options
Diffstat (limited to 'modules')
-rw-r--r-- | modules/context/repo.go | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/modules/context/repo.go b/modules/context/repo.go index 850b127e59..c61010ecba 100644 --- a/modules/context/repo.go +++ b/modules/context/repo.go @@ -507,7 +507,11 @@ func getRefName(ctx *Context, pathType RepoRefType) string { if refName := getRefName(ctx, RepoRefTag); len(refName) > 0 { return refName } - return getRefName(ctx, RepoRefCommit) + if refName := getRefName(ctx, RepoRefCommit); len(refName) > 0 { + return refName + } + ctx.Repo.TreePath = path + return ctx.Repo.Repository.DefaultBranch case RepoRefBranch: return getRefNameFromPath(ctx, path, ctx.Repo.GitRepo.IsBranchExist) case RepoRefTag: |