mirror of
https://codeberg.org/forgejo/forgejo.git
synced 2024-11-08 18:04:14 +01:00
Fix issue not auto-closing when it includes a reference to a branch (#22514)
Ensure branch prefix is stripped away for both when comparing the branch name.
This commit is contained in:
parent
e0a8965208
commit
cdf53fa4a7
1 changed files with 3 additions and 1 deletions
|
@ -18,6 +18,7 @@ import (
|
||||||
repo_model "code.gitea.io/gitea/models/repo"
|
repo_model "code.gitea.io/gitea/models/repo"
|
||||||
user_model "code.gitea.io/gitea/models/user"
|
user_model "code.gitea.io/gitea/models/user"
|
||||||
"code.gitea.io/gitea/modules/container"
|
"code.gitea.io/gitea/modules/container"
|
||||||
|
"code.gitea.io/gitea/modules/git"
|
||||||
"code.gitea.io/gitea/modules/log"
|
"code.gitea.io/gitea/modules/log"
|
||||||
"code.gitea.io/gitea/modules/references"
|
"code.gitea.io/gitea/modules/references"
|
||||||
"code.gitea.io/gitea/modules/repository"
|
"code.gitea.io/gitea/modules/repository"
|
||||||
|
@ -175,7 +176,8 @@ func UpdateIssuesCommit(doer *user_model.User, repo *repo_model.Repository, comm
|
||||||
if !repo.CloseIssuesViaCommitInAnyBranch {
|
if !repo.CloseIssuesViaCommitInAnyBranch {
|
||||||
// If the issue was specified to be in a particular branch, don't allow commits in other branches to close it
|
// If the issue was specified to be in a particular branch, don't allow commits in other branches to close it
|
||||||
if refIssue.Ref != "" {
|
if refIssue.Ref != "" {
|
||||||
if branchName != refIssue.Ref {
|
issueBranchName := strings.TrimPrefix(refIssue.Ref, git.BranchPrefix)
|
||||||
|
if branchName != issueBranchName {
|
||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
// Otherwise, only process commits to the default branch
|
// Otherwise, only process commits to the default branch
|
||||||
|
|
Loading…
Reference in a new issue