I am using a local BitBucket server with Git. I am trying to get started with Continous Integration so I\'ve set up a local Jenkins instance. The goal is to have Jenkins check o
See Daves answer for an explanation on why this "problem" arise and why Bitbucket is designed in this way.
However i was able to solve my specific problem by changing the settings in the Jenkin-plugin, to "trick" Bitbucket into updating the refs.
By setting the option Build only if Stash reports no conflicts
to true in Jenkins (Under Build Trigger
for the job), you force Bitbucket to update the refs which means you will check out the correct commit
See https://github.com/nemccarthy/stash-pullrequest-builder-plugin/issues/75 for details