Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in

Pull request is marked as merged even though it never was

Friedrich
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
March 6, 2024

I have a main branch, which has a branch a from it. This branch in turn has b branching off of it. a has already been merged through a pull request and b has an open one merging into a. I have pulled new changes from main to a after it has been merged, to update the diff of b's PR. For some reason this PR is now considered merged for BitBucket. The merge commit mentioned is an entirely different one that has nothing to do with these branches.

Here is a picture of the PR that somehow is marked as merged: (not PR #96)

falsely marked merged.png

 

And here is the PR which the merge commit actually belongs to: (PR #96)

actual PR for this merge.png

1 answer

1 vote
Patrik S
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
March 7, 2024

Hello @Friedrich and welcome to the Community!

The way that Bitbucket Cloud validates if a Pull Request is already merged is by checking the diffs between the source and destination branches. If the diff is empty, the pull request will be considered merged.

If all the commits that a pull request A was planning to merge are already part of another pull request B that was merged, the pull request A will also be considered merged by Bitbucket, even though you have not directly merged it in the UI.

This behavior is explained more in detail in the following article, along with the commands you can use locally to check the diffs between the branches involved in those pull requests: 

If after going through that article you have any questions, feel free to ask.

Thank you, @Friedrich !

Patrik S

 

Friedrich
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
March 11, 2024

Thank you!

This at least explains how a pull rquest could be considered merged even if no one manually merged it. But there were commits that did not exist on the source branch. They somehow got lost during a branch merge, which caused the diff to be empty. I "resolved" this by restoring the changes and opening a new pull request.

Like # people like this

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
CLOUD
TAGS
AUG Leaders

Atlassian Community Events