Hello,
We are using SonarQube 8.9 LTS and for analyzing branches, I changed the New Code definition like this:
However, after this change when I run the analysis, I get the following error in sonar-scanner output:
INFO: Computing New Code since fork with ‘refs/heads/master’
WARN: Could not find ref ‘refs/heads/master’ in refs/heads, refs/remotes, refs/remotes/upstream or refs/remotes/origin
WARN: Branch ‘refs/heads/master’ not found in git
WARN: Failed to detect fork date. No New Code will be computed.
I searched around and saw some other people asking similar questions in the past and the suggestion was to fetch master as a build step. But this feels very hacky so I wanted to know if there is another proper out of the box solution for this problem.
Software used:
- SonarQube 8.9.8 LTS
- TeamCity (teamcity.git.fetchAllHeads = true is set)