mirror of
https://github.com/go-gitea/gitea
synced 2024-09-27 00:37:49 +02:00
fix fork repo
This commit is contained in:
parent
facd6982e2
commit
af1b031c05
@ -197,16 +197,19 @@ func HookPostReceive(ctx *gitea_context.PrivateContext) {
|
||||
}
|
||||
}
|
||||
|
||||
// If our branch is the default branch of an unforked repo - there's no PR to create or refer to
|
||||
if !repo.IsFork && branch == baseRepo.DefaultBranch {
|
||||
if branch == baseRepo.DefaultBranch {
|
||||
// TODO: check IsWiki?
|
||||
err := repo_module.UpdateRepoLicenses(ctx, repo, nil)
|
||||
if err != nil {
|
||||
ctx.JSON(http.StatusInternalServerError, private.Response{Err: err.Error()})
|
||||
}
|
||||
|
||||
// If our branch is the default branch of an unforked repo - there's no PR to create or refer to
|
||||
if !repo.IsFork {
|
||||
results = append(results, private.HookPostReceiveBranchResult{})
|
||||
continue
|
||||
}
|
||||
}
|
||||
|
||||
pr, err := issues_model.GetUnmergedPullRequest(ctx, repo.ID, baseRepo.ID, branch, baseRepo.DefaultBranch, issues_model.PullRequestFlowGithub)
|
||||
if err != nil && !issues_model.IsErrPullRequestNotExist(err) {
|
||||
|
Loading…
Reference in New Issue
Block a user