Skip to content

Commit

Permalink
[FIXED JENKINS-13264] Allow checkout of submodules
Browse files Browse the repository at this point in the history
  • Loading branch information
mc1arke committed Jun 4, 2012
1 parent 64d4473 commit 70a90ec
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions src/main/java/hudson/scm/CVSSCM.java
Expand Up @@ -708,9 +708,14 @@ public boolean checkout(final AbstractBuild<?, ?> build, final Launcher launcher

for (CvsModule cvsModule : item.getModules()) {

final FilePath targetWorkspace = flatten ? workspace.getParent() : workspace;
boolean localSubModule = cvsModule.getCheckoutName().contains("/");
int lastSlash = cvsModule.getCheckoutName().lastIndexOf("/");

final String moduleName= flatten ? workspace.getName() : cvsModule.getCheckoutName();
final FilePath targetWorkspace = flatten ? workspace.getParent() :
localSubModule ? workspace.child(cvsModule.getCheckoutName().substring(0, lastSlash)) : workspace;

final String moduleName = flatten ? workspace.getName() :
localSubModule ? cvsModule.getCheckoutName().substring(lastSlash + 1) : cvsModule.getCheckoutName();

final FilePath module = targetWorkspace.child(moduleName);

Expand Down

0 comments on commit 70a90ec

Please sign in to comment.