Browse Source

Fix simple quality issues

tags/7.8
Janos Gyerik 5 years ago
parent
commit
3225550793

+ 3
- 2
sonar-scanner-engine/src/main/java/org/sonar/scanner/scm/ScmChangedFilesProvider.java View 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()));

Loading…
Cancel
Save