diff --git a/routers/web/repo/compare.go b/routers/web/repo/compare.go index 8b99dd95da..94e0c04394 100644 --- a/routers/web/repo/compare.go +++ b/routers/web/repo/compare.go @@ -407,6 +407,7 @@ func ParseCompareInfo(ctx *context.Context) *common.CompareInfo { ctx.ServerError("RepositoryFromRequestContextOrOpen", err) return nil } + // if it's not the same git repo, the HeadGitRepo should be closed out of the function } else { ctx.NotFound(nil) return nil