|
|
|
|
@ -1099,8 +1099,13 @@ func parseCompareInfo(ctx *context.APIContext, compareParam string) (result *par
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
if compareReq.HeadRepoName == "" {
|
|
|
|
|
if headUser.ID == baseRepo.OwnerID {
|
|
|
|
|
headRepo = baseRepo
|
|
|
|
|
} else {
|
|
|
|
|
// TODO: forked's fork
|
|
|
|
|
headRepo = repo_model.GetForkedRepo(ctx, headUser.ID, baseRepo.ID)
|
|
|
|
|
if headRepo == nil && headUser.ID != baseRepo.OwnerID {
|
|
|
|
|
if headRepo == nil {
|
|
|
|
|
// TODO: based's base?
|
|
|
|
|
err = baseRepo.GetBaseRepo(ctx)
|
|
|
|
|
if err != nil {
|
|
|
|
|
ctx.APIErrorInternal(err)
|
|
|
|
|
@ -1116,6 +1121,7 @@ func parseCompareInfo(ctx *context.APIContext, compareParam string) (result *par
|
|
|
|
|
// Assign headRepo so it can be used below.
|
|
|
|
|
headRepo = baseRepo.BaseRepo
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
} else {
|
|
|
|
|
if compareReq.HeadOwner == ctx.Repo.Owner.Name && compareReq.HeadRepoName == ctx.Repo.Repository.Name {
|
|
|
|
|
headRepo = ctx.Repo.Repository
|
|
|
|
|
|