mirror of
https://github.com/go-gitea/gitea
synced 2024-09-01 12:05:19 +02:00
Compare commits
7 Commits
b781506834
...
72ed356155
Author | SHA1 | Date | |
---|---|---|---|
|
72ed356155 | ||
|
e5e40787dc | ||
|
244c4feaf3 | ||
|
7a6c19b17a | ||
|
eb4fc987fe | ||
|
42955b6c7b | ||
|
eaf86259d3 |
@ -1110,9 +1110,20 @@ func parseCompareInfo(ctx *context.APIContext, form api.CreatePullRequestOption)
|
||||
// Check if current user has fork of repository or in the same repository.
|
||||
headRepo := repo_model.GetForkedRepo(ctx, headUser.ID, baseRepo.ID)
|
||||
if headRepo == nil && !isSameRepo {
|
||||
log.Trace("parseCompareInfo[%d]: does not have fork or in same repository", baseRepo.ID)
|
||||
ctx.NotFound("GetForkedRepo")
|
||||
return nil, nil, nil, "", ""
|
||||
err := baseRepo.GetBaseRepo(ctx)
|
||||
if err != nil {
|
||||
ctx.Error(http.StatusInternalServerError, "GetBaseRepo", err)
|
||||
return nil, nil, nil, "", ""
|
||||
}
|
||||
|
||||
// Check if baseRepo's base repository is the same as headUser's repository.
|
||||
if baseRepo.BaseRepo == nil || baseRepo.BaseRepo.OwnerID != headUser.ID {
|
||||
log.Trace("parseCompareInfo[%d]: does not have fork or in same repository", baseRepo.ID)
|
||||
ctx.NotFound("GetBaseRepo")
|
||||
return nil, nil, nil, "", ""
|
||||
}
|
||||
// Assign headRepo so it can be used below.
|
||||
headRepo = baseRepo.BaseRepo
|
||||
}
|
||||
|
||||
var headGitRepo *git.Repository
|
||||
|
@ -29,7 +29,7 @@
|
||||
"sourceMap": true,
|
||||
"types": [
|
||||
"vitest/globals",
|
||||
"./types.d.ts",
|
||||
"./web_src/js/globals.d.ts",
|
||||
],
|
||||
}
|
||||
}
|
||||
|
0
types.d.ts → web_src/js/globals.d.ts
vendored
0
types.d.ts → web_src/js/globals.d.ts
vendored
Loading…
Reference in New Issue
Block a user