Fix code formatting
This commit is contained in:
parent
13df8f596e
commit
f4d086b1f5
|
|
@ -83,15 +83,15 @@ func assembleKeywordsPattern(words []string) string {
|
||||||
func init() {
|
func init() {
|
||||||
// populate with details to find keywords for reference, reopen, close
|
// populate with details to find keywords for reference, reopen, close
|
||||||
issueKeywordsToFind = []*IssueKeywordsToFind{
|
issueKeywordsToFind = []*IssueKeywordsToFind{
|
||||||
&IssueKeywordsToFind{
|
{
|
||||||
Pattern: regexp.MustCompile(issueRefRegexpStr),
|
Pattern: regexp.MustCompile(issueRefRegexpStr),
|
||||||
KeywordsFoundMask: KeywordsFoundReference,
|
KeywordsFoundMask: KeywordsFoundReference,
|
||||||
},
|
},
|
||||||
&IssueKeywordsToFind{
|
{
|
||||||
Pattern: regexp.MustCompile(assembleKeywordsPattern(issueReopenKeywords)),
|
Pattern: regexp.MustCompile(assembleKeywordsPattern(issueReopenKeywords)),
|
||||||
KeywordsFoundMask: KeywordsFoundReopen,
|
KeywordsFoundMask: KeywordsFoundReopen,
|
||||||
},
|
},
|
||||||
&IssueKeywordsToFind{
|
{
|
||||||
Pattern: regexp.MustCompile(assembleKeywordsPattern(issueCloseKeywords)),
|
Pattern: regexp.MustCompile(assembleKeywordsPattern(issueCloseKeywords)),
|
||||||
KeywordsFoundMask: KeywordsFoundClose,
|
KeywordsFoundMask: KeywordsFoundClose,
|
||||||
},
|
},
|
||||||
|
|
@ -509,13 +509,13 @@ func UpdateIssuesCommit(doer *User, repo *Repository, commits []*PushCommit, com
|
||||||
|
|
||||||
if commitsAreMerged {
|
if commitsAreMerged {
|
||||||
// take no action if both KeywordsFoundClose and KeywordsFoundOpen are set
|
// take no action if both KeywordsFoundClose and KeywordsFoundOpen are set
|
||||||
if (mask & (KeywordsFoundReopen|KeywordsFoundClose)) == KeywordsFoundClose {
|
if (mask & (KeywordsFoundReopen | KeywordsFoundClose)) == KeywordsFoundClose {
|
||||||
if issue.RepoID == repo.ID && !issue.IsClosed {
|
if issue.RepoID == repo.ID && !issue.IsClosed {
|
||||||
if err = issue.ChangeStatus(doer, repo, true); err != nil {
|
if err = issue.ChangeStatus(doer, repo, true); err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} else if (mask & (KeywordsFoundReopen|KeywordsFoundClose)) == KeywordsFoundReopen {
|
} else if (mask & (KeywordsFoundReopen | KeywordsFoundClose)) == KeywordsFoundReopen {
|
||||||
if issue.RepoID == repo.ID && issue.IsClosed {
|
if issue.RepoID == repo.ID && issue.IsClosed {
|
||||||
if err = issue.ChangeStatus(doer, repo, false); err != nil {
|
if err = issue.ChangeStatus(doer, repo, false); err != nil {
|
||||||
return err
|
return err
|
||||||
|
|
|
||||||
|
|
@ -777,10 +777,10 @@ func NewPullRequest(repo *Repository, pull *Issue, labelIDs []int64, uuids []str
|
||||||
mode, _ := AccessLevel(pull.Poster.ID, repo)
|
mode, _ := AccessLevel(pull.Poster.ID, repo)
|
||||||
|
|
||||||
var (
|
var (
|
||||||
baseBranch *Branch
|
baseBranch *Branch
|
||||||
headBranch *Branch
|
headBranch *Branch
|
||||||
baseCommit *git.Commit
|
baseCommit *git.Commit
|
||||||
headCommit *git.Commit
|
headCommit *git.Commit
|
||||||
baseGitRepo *git.Repository
|
baseGitRepo *git.Repository
|
||||||
)
|
)
|
||||||
if baseBranch, err = pr.BaseRepo.GetBranch(pr.BaseBranch); err != nil {
|
if baseBranch, err = pr.BaseRepo.GetBranch(pr.BaseBranch); err != nil {
|
||||||
|
|
|
||||||
|
|
@ -298,10 +298,10 @@ func pushUpdate(branch string, opts PushUpdateOptions) (repo *Repository, err er
|
||||||
}
|
}
|
||||||
|
|
||||||
var (
|
var (
|
||||||
baseBranch *Branch
|
baseBranch *Branch
|
||||||
headBranch *Branch
|
headBranch *Branch
|
||||||
baseCommit *git.Commit
|
baseCommit *git.Commit
|
||||||
headCommit *git.Commit
|
headCommit *git.Commit
|
||||||
headGitRepo *git.Repository
|
headGitRepo *git.Repository
|
||||||
)
|
)
|
||||||
if baseBranch, err = pr.BaseRepo.GetBranch(pr.BaseBranch); err != nil {
|
if baseBranch, err = pr.BaseRepo.GetBranch(pr.BaseBranch); err != nil {
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user