File tree Expand file tree Collapse file tree 2 files changed +6
-2
lines changed Expand file tree Collapse file tree 2 files changed +6
-2
lines changed Original file line number Diff line number Diff line change @@ -122,6 +122,7 @@ const (
122
122
PullRequestStatusManuallyMerged
123
123
PullRequestStatusError
124
124
PullRequestStatusEmpty
125
+ PullRequestStatusAncestor
125
126
)
126
127
127
128
// PullRequestFlow the flow of pull request
@@ -425,7 +426,7 @@ func (pr *PullRequest) IsEmpty() bool {
425
426
426
427
// IsAncestor returns true if the Head Commit of this PR is an ancestor of the Base Commit
427
428
func (pr * PullRequest ) IsAncestor () bool {
428
- return pr .HeadCommitID == pr . MergeBase
429
+ return pr .Status == PullRequestStatusAncestor
429
430
}
430
431
431
432
// SetMerged sets a pull request to merged and closes the corresponding issue
Original file line number Diff line number Diff line change @@ -87,9 +87,12 @@ func TestPatch(pr *issues_model.PullRequest) error {
87
87
}
88
88
}
89
89
pr .MergeBase = strings .TrimSpace (pr .MergeBase )
90
+ if pr .HeadCommitID , err = gitRepo .GetBranchCommitID ("tracking" ); err != nil {
91
+ return fmt .Errorf ("GetBranchCommitID: can't find commit ID for head: %w" , err )
92
+ }
90
93
91
94
if pr .HeadCommitID == pr .MergeBase {
92
- pr .Status = issues_model .PullRequestStatusEmpty
95
+ pr .Status = issues_model .PullRequestStatusAncestor
93
96
return nil
94
97
}
95
98
You can’t perform that action at this time.
0 commit comments