aboutsummaryrefslogtreecommitdiff
path: root/routers/repo/repo.go
diff options
context:
space:
mode:
Diffstat (limited to 'routers/repo/repo.go')
-rw-r--r--routers/repo/repo.go4
1 files changed, 3 insertions, 1 deletions
diff --git a/routers/repo/repo.go b/routers/repo/repo.go
index 3b57cb39..e7107ad1 100644
--- a/routers/repo/repo.go
+++ b/routers/repo/repo.go
@@ -85,9 +85,11 @@ func Single(ctx *middleware.Context, params martini.Params) {
ctx.Data["Branches"] = brs
var commitId string
- if !models.IsBranchExist(userName, repoName, branchName) {
+ isViewBranch := models.IsBranchExist(userName, repoName, branchName)
+ if !isViewBranch {
commitId = branchName
}
+ ctx.Data["IsViewBranch"] = isViewBranch
repoFile, err := models.GetTargetFile(userName, repoName,
branchName, commitId, treename)