Skip to content

Commit

Permalink
[JENKINS-7376] Clean submodules whenever cleaning superproject (after…
Browse files Browse the repository at this point in the history
… checkout), unless submodules are disabled
  • Loading branch information
Rafal Zwierz committed Oct 17, 2012
1 parent eecf244 commit abe5ceb
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/main/java/hudson/plugins/git/GitSCM.java
Expand Up @@ -1234,6 +1234,10 @@ public BuildData invoke(File localWorkspace, VirtualChannel channel)
if (getClean()) {
listener.getLogger().println("Cleaning workspace");
git.clean();

if (git.hasGitModules() && !disableSubmodules) {
git.submoduleClean(recursiveSubmodules);
}
}

git.checkoutBranch(paramLocalBranch, revToBuild.getSha1().name());
Expand Down

0 comments on commit abe5ceb

Please sign in to comment.