|
|
|
@ -215,21 +215,19 @@ func ParseCompareInfo(ctx *context.Context) *CompareInfo { |
|
|
|
|
) |
|
|
|
|
|
|
|
|
|
infoPath = ctx.Params("*") |
|
|
|
|
infos := strings.SplitN(infoPath, "...", 2) |
|
|
|
|
|
|
|
|
|
var infos []string |
|
|
|
|
if infoPath == "" { |
|
|
|
|
infos = []string{baseRepo.DefaultBranch, baseRepo.DefaultBranch} |
|
|
|
|
} else { |
|
|
|
|
infos = strings.SplitN(infoPath, "...", 2) |
|
|
|
|
if len(infos) != 2 { |
|
|
|
|
infos = []string{baseRepo.DefaultBranch, infoPath} |
|
|
|
|
if strings.Contains(infoPath, "..") { |
|
|
|
|
infos = strings.SplitN(infoPath, "..", 2) |
|
|
|
|
if infos = strings.SplitN(infoPath, "..", 2); len(infos) == 2 { |
|
|
|
|
ci.DirectComparison = true |
|
|
|
|
ctx.Data["PageIsComparePull"] = false |
|
|
|
|
} else { |
|
|
|
|
infos = []string{baseRepo.DefaultBranch, infoPath} |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
if len(infos) != 2 { |
|
|
|
|
log.Trace("ParseCompareInfo[%d]: not enough compared branches information %s", baseRepo.ID, infos) |
|
|
|
|
ctx.NotFound("CompareAndPullRequest", nil) |
|
|
|
|
return nil |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
ctx.Data["BaseName"] = baseRepo.OwnerName |
|
|
|
|