Fix API raw file content access for default branch (#2849)

This commit is contained in:
Lauris BH authored and GitHub committed 2017-11-04 19:26:38 +02:00
1 parent 76b8c3c68f
commit 57de1ff991
2 files changed
+8 -1

No files matched your search

+5 -1
View File
@@ -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: