From 455f7481a5a5ff670fe6797348fede07ca81e6f8 Mon Sep 17 00:00:00 2001 From: Roberto Perez Alcolea Date: Tue, 27 Jun 2023 11:09:05 -0700 Subject: [PATCH] GitScmProvider: handle missing git information for calculateModuleSource --- src/main/groovy/nebula/plugin/info/scm/GitScmProvider.groovy | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/main/groovy/nebula/plugin/info/scm/GitScmProvider.groovy b/src/main/groovy/nebula/plugin/info/scm/GitScmProvider.groovy index d1aa61d..46f3176 100644 --- a/src/main/groovy/nebula/plugin/info/scm/GitScmProvider.groovy +++ b/src/main/groovy/nebula/plugin/info/scm/GitScmProvider.groovy @@ -51,6 +51,9 @@ class GitScmProvider extends AbstractScmProvider { @Override String calculateModuleSource(File projectDir) { String gitWorkDir = executeGitCommand("git", "rev-parse", "--show-toplevel") + if(!gitWorkDir) { + return projectDir.absolutePath + } return projectDir.absolutePath - new File(gitWorkDir).absolutePath }