]> source.dussan.org Git - sonarqube.git/commitdiff
Fix simple quality issues
authorJanos Gyerik <janos.gyerik@sonarsource.com>
Mon, 8 Apr 2019 12:00:33 +0000 (14:00 +0200)
committerSonarTech <sonartech@sonarsource.com>
Tue, 9 Apr 2019 18:21:05 +0000 (20:21 +0200)
sonar-scanner-engine/src/main/java/org/sonar/scanner/scm/ScmChangedFilesProvider.java

index 454d2a6815a2f8b72e8605f8d2edc366f49a67f1..63f30c85f2c70b760694b72e225aa230f19d73e4 100644 (file)
@@ -63,11 +63,12 @@ public class ScmChangedFilesProvider extends ProviderAdapter {
 
   @CheckForNull
   private static Collection<Path> loadChangedFilesIfNeeded(ScmConfiguration scmConfiguration, BranchConfiguration branchConfiguration, Path rootBaseDir) {
-    if (branchConfiguration.isShortOrPullRequest() && branchConfiguration.targetScmBranch() != null) {
+    String targetScmBranch = branchConfiguration.targetScmBranch();
+    if (branchConfiguration.isShortOrPullRequest() && targetScmBranch != null) {
       ScmProvider scmProvider = scmConfiguration.provider();
       if (scmProvider != null) {
         Profiler profiler = Profiler.create(LOG).startInfo(LOG_MSG);
-        Collection<Path> changedFiles = scmProvider.branchChangedFiles(branchConfiguration.targetScmBranch(), rootBaseDir);
+        Collection<Path> changedFiles = scmProvider.branchChangedFiles(targetScmBranch, rootBaseDir);
         profiler.stopInfo();
         if (changedFiles != null) {
           LOG.debug("SCM reported {} {} changed in the branch", changedFiles.size(), ScannerUtils.pluralize("file", changedFiles.size()));