Skip to content

Commit 68c4d7e

Browse files
committed
Use gitRepo.GetRefCommitID to be consistent
1 parent 66686f6 commit 68c4d7e

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

services/pull/patch.go

+8
Original file line numberDiff line numberDiff line change
@@ -87,6 +87,14 @@ func TestPatch(pr *issues_model.PullRequest) error {
8787
}
8888
}
8989
pr.MergeBase = strings.TrimSpace(pr.MergeBase)
90+
if pr.HeadCommitID, err = gitRepo.GetRefCommitID(git.BranchPrefix + "tracking"); err != nil {
91+
return fmt.Errorf("GetBranchCommitID: can't find commit ID for head: %w", err)
92+
}
93+
94+
if pr.HeadCommitID == pr.MergeBase {
95+
pr.Status = issues_model.PullRequestStatusAncestor
96+
return nil
97+
}
9098

9199
// 2. Check for conflicts
92100
if conflicts, err := checkConflicts(ctx, pr, gitRepo, tmpBasePath); err != nil || conflicts || pr.Status == issues_model.PullRequestStatusEmpty {

0 commit comments

Comments
 (0)