Decorate PR analysis to Bitbucket Server failed

Hi,

As @barclay-reg mentioned, to fix the first issue, you should ensure we can compute the diff between PR branch and target/base. So you have to fetch it.

For the second issue, this is a requirement of the Bitbucket Server API to pass the HEAD commit of the PR when publishing a report. By default we get this commit sha1 by simply looking t the current HEAD of the local repo. If you are doing some SCM operations that are modifying the local repo, you can try to pass manually: -Dsonar.pullrequest.bitbucketserver.headSha=xxxxx to the scanner.
For Jenkins, this is probably something like: -Dsonar.pullrequest.bitbucketserver.headSha=${env.GIT_COMMIT}

Note that in SonarQube 7.8 we are working on improving the situation, by looking at CI environment variables and trying to guess sensible defaults.
https://jira.sonarsource.com/browse/SONAR-11950
https://jira.sonarsource.com/browse/MMF-1676