Skip to content

Commit

Permalink
GitScmProvider: handle missing git information for calculateModuleSource
Browse files Browse the repository at this point in the history
  • Loading branch information
rpalcolea committed Jun 27, 2023
1 parent 03e6b08 commit 455f748
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/main/groovy/nebula/plugin/info/scm/GitScmProvider.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -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
}

Expand Down

0 comments on commit 455f748

Please sign in to comment.