in wagon-providers/wagon-scm/src/main/java/org/apache/maven/wagon/providers/scm/ScmWagon.java [662:696]
private ScmResult tryPartialCheckout(String subdir, boolean recursiveArg) throws ScmException, IOException {
String url = getRepository().getUrl();
String desiredPartCOSubdir = "";
ScmRepository scmRepository = getScmRepository(url);
ScmProvider scmProvider = getScmProvider(scmRepository.getProvider());
if (subdir.length() != 0 && supportsPartialCheckout(scmProvider)) {
url += (url.endsWith("/") ? "" : "/") + subdir;
desiredPartCOSubdir = subdir + "/";
scmRepository = getScmRepository(url);
}
boolean recursive = recursiveArg | isAlwaysRecursive(scmProvider);
if (!desiredPartCOSubdir.equals(partCOSubdir)) {
deleteCheckoutDirectory();
partCOSubdir = desiredPartCOSubdir;
}
if (recursive && !haveRecursiveCO) {
deleteCheckoutDirectory();
}
ScmResult res;
if (checkoutDirExists(scmProvider)) {
res = scmProvider.update(scmRepository, new ScmFileSet(checkoutDirectory), makeScmVersion());
} else {
res = checkOut(scmProvider, scmRepository, new ScmFileSet(checkoutDirectory), recursive);
haveRecursiveCO = recursive && res.isSuccess();
}
return res;
}