|
|
|
@ -226,8 +226,13 @@ func ParseCompareInfo(ctx *context.Context) *common.CompareInfo {
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
if compareReq.HeadRepoName == "" {
|
|
|
|
if compareReq.HeadRepoName == "" {
|
|
|
|
|
|
|
|
if ci.HeadUser.ID == baseRepo.OwnerID {
|
|
|
|
|
|
|
|
ci.HeadRepo = baseRepo
|
|
|
|
|
|
|
|
} else {
|
|
|
|
|
|
|
|
// TODO: forked's fork
|
|
|
|
ci.HeadRepo = repo_model.GetForkedRepo(ctx, ci.HeadUser.ID, baseRepo.ID)
|
|
|
|
ci.HeadRepo = repo_model.GetForkedRepo(ctx, ci.HeadUser.ID, baseRepo.ID)
|
|
|
|
if ci.HeadRepo == nil && ci.HeadUser.ID != baseRepo.OwnerID {
|
|
|
|
if ci.HeadRepo == nil {
|
|
|
|
|
|
|
|
// TODO: based's base?
|
|
|
|
err = baseRepo.GetBaseRepo(ctx)
|
|
|
|
err = baseRepo.GetBaseRepo(ctx)
|
|
|
|
if err != nil {
|
|
|
|
if err != nil {
|
|
|
|
ctx.ServerError("GetBaseRepo", err)
|
|
|
|
ctx.ServerError("GetBaseRepo", err)
|
|
|
|
@ -243,6 +248,7 @@ func ParseCompareInfo(ctx *context.Context) *common.CompareInfo {
|
|
|
|
// Assign headRepo so it can be used below.
|
|
|
|
// Assign headRepo so it can be used below.
|
|
|
|
ci.HeadRepo = baseRepo.BaseRepo
|
|
|
|
ci.HeadRepo = baseRepo.BaseRepo
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
} else {
|
|
|
|
} else {
|
|
|
|
if compareReq.HeadOwner == ctx.Repo.Owner.Name && compareReq.HeadRepoName == ctx.Repo.Repository.Name {
|
|
|
|
if compareReq.HeadOwner == ctx.Repo.Owner.Name && compareReq.HeadRepoName == ctx.Repo.Repository.Name {
|
|
|
|
ci.HeadRepo = ctx.Repo.Repository
|
|
|
|
ci.HeadRepo = ctx.Repo.Repository
|
|
|
|
|