/** {@inheritDoc} */ public void clone(String url, String origin, boolean useShallowClone, String reference) throws GitException, InterruptedException { CloneCommand c = clone_().url(url).repositoryName(origin).reference(reference); if (useShallowClone) c.shallow(); c.execute(); }
@Override public void decorateCloneCommand(GitSCM scm, Run<?, ?> build, GitClient git, TaskListener listener, CloneCommand cmd) throws IOException, InterruptedException, GitException { if (! sparseCheckoutPaths.isEmpty()) { listener.getLogger().println("Using no checkout clone with sparse checkout."); cmd.noCheckout(); } }
if (shallow) { listener.getLogger().println("Using shallow clone"); cmd.shallow(); if (depth > 1) { listener.getLogger().println("shallow clone depth " + depth); cmd.depth(depth); cmd.tags(false); cmd.refspecs(refspecs); cmd.timeout(timeout); cmd.reference(build.getEnvironment(listener).expand(reference));
CloneCommand cmd = git.clone_().url(rc.getURIs().get(0).toPrivateString()).repositoryName(rc.getName()); for (GitSCMExtension ext : extensions) { ext.decorateCloneCommand(this, build, git, listener, cmd); cmd.execute(); } catch (GitException ex) { ex.printStackTrace(listener.error("Error cloning remote repo '" + rc.getName() + "'"));
@Override public void decorateCloneCommand(GitSCM scm, Run<?, ?> build, GitClient git, TaskListener listener, CloneCommand cmd) throws IOException, InterruptedException, GitException { // we are doing a merge, so cannot permit a shallow clone cmd.shallow(false); }
/** * {@inheritDoc} */ @Override public void decorateCloneCommand(GitSCM scm, Run<?, ?> build, GitClient git, TaskListener listener, CloneCommand cmd) throws IOException, InterruptedException, GitException { listener.getLogger() .printf("Cloning with configured refspecs honoured and %s tags%n", includeTags ? "with" : "without"); RemoteConfig rc = scm.getRepositories().get(0); List<RefSpec> refspecs = rc.getFetchRefSpecs(); cmd.refspecs(refspecs); cmd.tags(includeTags); }