/** * {@inheritDoc} */ @Override public void decorateFetchCommand(GitSCM scm, GitClient git, TaskListener listener, FetchCommand cmd) throws IOException, InterruptedException, GitException { cmd.shallow(shallow); if (shallow && depth > 1) { cmd.depth(depth); } cmd.tags(!noTags); /* cmd.refspecs() not required. * FetchCommand already requires list of refspecs through its * from(remote, refspecs) method, no need to adjust refspecs * here on initial clone */ cmd.timeout(timeout); }
/** * {@inheritDoc} * * @param url a {@link org.eclipse.jgit.transport.URIish} object. * @param refspecs a {@link java.util.List} object. * @throws hudson.plugins.git.GitException if any. * @throws java.lang.InterruptedException if any. */ @Override public void fetch(URIish url, List<RefSpec> refspecs) throws GitException, InterruptedException { fetch_().from(url, refspecs).execute(); }
/** * {@inheritDoc} */ @Override public void decorateFetchCommand(GitSCM scm, GitClient git, TaskListener listener, FetchCommand cmd) throws IOException, InterruptedException, GitException { listener.getLogger().println("Pruning obsolete local branches"); cmd.prune(); }
@Override public void decorateFetchCommand(GitSCM scm, GitClient git, TaskListener listener, FetchCommand cmd) throws IOException, InterruptedException, GitException { // we are doing a merge, so cannot permit a shallow clone cmd.shallow(false); }
/** * {@inheritDoc} */ @Override public void decorateFetchCommand(GitSCM scm, GitClient git, TaskListener listener, FetchCommand cmd) throws IOException, InterruptedException, GitException { listener.getLogger() .printf("Fetching %s tags%n", includeTags ? "with" : "without"); cmd.tags(includeTags); } }
listener.getLogger().println("URI syntax exception for '" + remoteName + "' " + ex); client.fetch_().prune().from(remoteURI, builder.asRefSpecs()).execute(); listener.getLogger().println("Done."); return new GitSCMFileSystem(client, gitSCMSource.getRemote(), Constants.R_REMOTES+remoteName+"/"+head.getName(),
client.fetch_().prune().from(remoteURI, Arrays .asList(new RefSpec( "+" + Constants.R_HEADS + headName + ":" + Constants.R_REMOTES + remoteName + "/" + headName))).execute(); listener.getLogger().println("Done."); return new GitSCMFileSystem(client, remote, Constants.R_REMOTES + remoteName + "/" +headName, (AbstractGitSCMSource.SCMRevisionImpl) rev);
FetchCommand fetch = git.fetch_().from(url, remoteRepository.getFetchRefSpecs()); for (GitSCMExtension extension : extensions) { extension.decorateFetchCommand(this, git, listener, fetch); fetch.execute(); } catch (GitException ex) { throw new GitException("Failed to fetch from "+url.toString(), ex);