Skip to content

Commit

Permalink
Check a parent branch merge commit exists or not (#353)
Browse files Browse the repository at this point in the history
to detect reason and explain it for #305

(Does this change work as you intended?)
  • Loading branch information
Konboi authored Jun 27, 2024
1 parent ae87eea commit 86ab3e9
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions internal/actions/pr.go
Original file line number Diff line number Diff line change
Expand Up @@ -265,6 +265,11 @@ func CreatePullRequest(
return nil, errors.Errorf("no commits between %q and %q", prCompareRef, opts.BranchName)
}

// Check if a parent branch has already been merged or not
if parentMeta.MergeCommit != "" {
return nil, errors.Errorf("failed to create a pull request. The parent branch %q has already been merged\nPlease run av stack sync to rebase the branch first.", parentMeta.Name)
}

if existingPR != nil {
// If there's an existing PR, use that as the new PR title and body. If --edit is
// used, an editor is opened later.
Expand Down

0 comments on commit 86ab3e9

Please sign in to comment.