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 (
122122 PullRequestStatusManuallyMerged
123123 PullRequestStatusError
124124 PullRequestStatusEmpty
125+ PullRequestStatusAncestor
125126)
126127
127128// PullRequestFlow the flow of pull request
@@ -425,7 +426,7 @@ func (pr *PullRequest) IsEmpty() bool {
425426
426427// IsAncestor returns true if the Head Commit of this PR is an ancestor of the Base Commit
427428func (pr * PullRequest ) IsAncestor () bool {
428- return pr .HeadCommitID == pr . MergeBase
429+ return pr .Status == PullRequestStatusAncestor
429430}
430431
431432// 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 {
8787 }
8888 }
8989 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+ }
9093
9194 if pr .HeadCommitID == pr .MergeBase {
92- pr .Status = issues_model .PullRequestStatusEmpty
95+ pr .Status = issues_model .PullRequestStatusAncestor
9396 return nil
9497 }
9598
You can’t perform that action at this time.
0 commit comments