In Bitbucket 4.13, the mechanism for resolving refs (determining the current commit the branch/tag references) was refactored. The new implementation does not properly handle concurrent updates to the ref, which can result in the ref not resolving properly. When this happens, Bitbucket incorrectly concludes that the branch or tag does not exist.
The problem is most visible when pull requests are updated as a result of an update to the source or target branch. This can result in:
- the pull request being declined (because the source/target branch appeared to be deleted)
- the pull request incorrectly reporting that multiple commits were removed from the pull request. This happens because the loose ref in the repository did not resolve, but an older version of the ref was present in packed-refs. To the pull request rescope process, it appears that the branch was reset to the older hash.
- If the pull request was declined, it can be reopened.
- If the pull request displays the incorrect scope, decline and reopen the pull request to refresh it.