aboutsummaryrefslogtreecommitdiffstats
path: root/sonar-scanner-engine/src/main/java
diff options
context:
space:
mode:
authorJacek <jacek.poreda@sonarsource.com>2022-04-11 10:21:00 +0200
committersonartech <sonartech@sonarsource.com>2022-04-11 20:02:58 +0000
commitd3c6630b95fffa9c37a245672f25bdd412befc9b (patch)
tree49ed53277eb7cf139eb85b6e8bab073cd77de431 /sonar-scanner-engine/src/main/java
parentb574e0fd48c458e057e72b5f15b013cdc1d9e574 (diff)
downloadsonarqube-d3c6630b95fffa9c37a245672f25bdd412befc9b.tar.gz
sonarqube-d3c6630b95fffa9c37a245672f25bdd412befc9b.zip
SONAR-16080 Skipping git ignore collection for git submodules which were not cloned
Diffstat (limited to 'sonar-scanner-engine/src/main/java')
-rw-r--r--sonar-scanner-engine/src/main/java/org/sonar/scm/git/IncludedFilesRepository.java4
1 files changed, 4 insertions, 0 deletions
diff --git a/sonar-scanner-engine/src/main/java/org/sonar/scm/git/IncludedFilesRepository.java b/sonar-scanner-engine/src/main/java/org/sonar/scm/git/IncludedFilesRepository.java
index 73bc85aeb26..af1b7ea29cd 100644
--- a/sonar-scanner-engine/src/main/java/org/sonar/scm/git/IncludedFilesRepository.java
+++ b/sonar-scanner-engine/src/main/java/org/sonar/scm/git/IncludedFilesRepository.java
@@ -81,6 +81,10 @@ public class IncludedFilesRepository {
try (SubmoduleWalk submoduleWalk = SubmoduleWalk.forIndex(repo)) {
while (submoduleWalk.next()) {
try (Repository submoduleRepo = submoduleWalk.getRepository()) {
+ if (submoduleRepo == null) {
+ LOG.debug("Git submodule [{}] found, but has not been cloned, skipping.", submoduleWalk.getPath());
+ continue;
+ }
collectFilesIterative(submoduleRepo, baseDir);
}
}