michael-o closed pull request #37: added recursive support with submodule clone URL: https://github.com/apache/maven-scm/pull/37
This is a PR merged from a forked repository. As GitHub hides the original diff on merge, it is displayed below for the sake of provenance: As this is a foreign pull request (from a fork), the diff is supplied below (as it won't show otherwise due to GitHub magic): diff --git a/maven-scm-providers/maven-scm-providers-git/maven-scm-provider-gitexe/src/main/java/org/apache/maven/scm/provider/git/gitexe/command/checkout/GitCheckOutCommand.java b/maven-scm-providers/maven-scm-providers-git/maven-scm-provider-gitexe/src/main/java/org/apache/maven/scm/provider/git/gitexe/command/checkout/GitCheckOutCommand.java index 33431e5ec..12627b940 100644 --- a/maven-scm-providers/maven-scm-providers-git/maven-scm-provider-gitexe/src/main/java/org/apache/maven/scm/provider/git/gitexe/command/checkout/GitCheckOutCommand.java +++ b/maven-scm-providers/maven-scm-providers-git/maven-scm-provider-gitexe/src/main/java/org/apache/maven/scm/provider/git/gitexe/command/checkout/GitCheckOutCommand.java @@ -126,6 +126,24 @@ protected CheckOutScmResult executeCheckOutCommand( ScmProviderRepository repo, lastCommandLine = clCheckout.toString(); } + if ( recursive ) + { + // and now lets pull down the submodules + Commandline clSubmodule = GitCommandLineUtils.getBaseGitCommandLine( + fileSet.getBasedir(), "submodule" ); + clSubmodule.createArg().setValue( "update" ); + clSubmodule.createArg().setValue( "--init" ); + clSubmodule.createArg().setValue( "--recursive" ); + clSubmodule.createArg().setValue( "--remote" ); + exitCode = GitCommandLineUtils.execute( clSubmodule, stdout, stderr, getLogger() ) ; + if ( exitCode != 0 ) + { + return new CheckOutScmResult( clSubmodule.toString(), "The git-submodule command failed.", + stderr.getOutput(), false ); + } + lastCommandLine = clSubmodule.toString(); + } + // and now search for the files GitListConsumer listConsumer = new GitListConsumer( getLogger(), fileSet.getBasedir(), ScmFileStatus.CHECKED_IN ); ---------------------------------------------------------------- This is an automated message from the Apache Git Service. To respond to the message, please log on GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org With regards, Apache Git Services