Don't attempt to close issue if already closed (#9696)
Co-authored-by: Lauris BH <lauris@nix.lv>
This commit is contained in:
parent
438e159d04
commit
705b1e49a8
|
@ -138,9 +138,11 @@ func UpdateIssuesCommit(doer *models.User, repo *models.Repository, commits []*r
|
||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
close := (ref.Action == references.XRefActionCloses)
|
||||||
if err := changeIssueStatus(refRepo, refIssue, doer, ref.Action == references.XRefActionCloses); err != nil {
|
if close != refIssue.IsClosed {
|
||||||
return err
|
if err := changeIssueStatus(refRepo, refIssue, doer, close); err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -374,8 +374,10 @@ func Merge(pr *models.PullRequest, doer *models.User, baseGitRepo *git.Repositor
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
close := (ref.RefAction == references.XRefActionCloses)
|
close := (ref.RefAction == references.XRefActionCloses)
|
||||||
if err = issue_service.ChangeStatus(ref.Issue, doer, close); err != nil {
|
if close != ref.Issue.IsClosed {
|
||||||
return err
|
if err = issue_service.ChangeStatus(ref.Issue, doer, close); err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue