aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--routers/web/repo/compare.go4
1 files changed, 3 insertions, 1 deletions
diff --git a/routers/web/repo/compare.go b/routers/web/repo/compare.go
index ecc8e66702..9af1d60c29 100644
--- a/routers/web/repo/compare.go
+++ b/routers/web/repo/compare.go
@@ -252,7 +252,6 @@ func ParseCompareInfo(ctx *context.Context) *CompareInfo {
isSameRepo = true
ci.HeadUser = ctx.Repo.Owner
ci.HeadBranch = headInfos[0]
-
} else if len(headInfos) == 2 {
headInfosSplit := strings.Split(headInfos[0], "/")
if len(headInfosSplit) == 1 {
@@ -407,6 +406,9 @@ func ParseCompareInfo(ctx *context.Context) *CompareInfo {
return nil
}
defer ci.HeadGitRepo.Close()
+ } else {
+ ctx.NotFound("ParseCompareInfo", nil)
+ return nil
}
ctx.Data["HeadRepo"] = ci.HeadRepo