/** {@inheritDoc} */ public void checkoutBranch(String branch, String ref) throws GitException, InterruptedException { checkout().ref(ref).branch(branch).deleteBranchIfExist(true).execute(); }
@Override public void decorateCheckoutCommand(GitSCM scm, Run<?, ?> build, GitClient git, TaskListener listener, CheckoutCommand cmd) throws IOException, InterruptedException, GitException { cmd.sparseCheckoutPaths(Lists.transform(sparseCheckoutPaths, SparseCheckoutPath.SPARSE_CHECKOUT_PATH_TO_PATH)); }
/** * {@inheritDoc} */ @Override public void decorateCheckoutCommand(GitSCM scm, Run<?, ?> build, GitClient git, TaskListener listener, CheckoutCommand cmd) throws IOException, InterruptedException, GitException { cmd.timeout(timeout); }
/** * {@inheritDoc} */ @Override public void decorateCheckoutCommand(GitSCM scm, Run<?, ?> build, GitClient git, TaskListener listener, CheckoutCommand cmd) throws IOException, InterruptedException, GitException { listener.getLogger().println("Enabling Git LFS pull"); List<RemoteConfig> repos = scm.getParamExpandedRepos(build, listener); // repos should never be empty, but check anyway if (!repos.isEmpty()) { // Pull LFS files from the first configured repository. // Same technique is used in GitSCM and CLoneOption. // Assumes the passed in scm represents a single repository, or if // multiple repositories are in use, the first repository in the // configuration is treated as authoritative. // Git plugin does not support multiple independent repositories // in a single job definition. cmd.lfsRemote(repos.get(0).getName()); } }
private void checkout(GitSCM scm, Run<?, ?> build, GitClient git, TaskListener listener, Revision rev) throws InterruptedException, IOException, GitException { CheckoutCommand checkoutCommand = git.checkout().ref(rev.getSha1String()); for (GitSCMExtension ext : scm.getExtensions()) { ext.decorateCheckoutCommand(scm, build, git, listener, checkoutCommand); } checkoutCommand.execute(); } }
CheckoutCommand checkoutCommand = git.checkout().branch(paramLocalBranch).ref(remoteBranchRef).deleteBranchIfExist(true); for (GitSCMExtension ext : scm.getExtensions()) ext.decorateCheckoutCommand(scm, build, git, listener, checkoutCommand); checkoutCommand.execute(); checkoutCommand = git.checkout().branch(paramLocalBranch).ref(rev.getSha1String()).deleteBranchIfExist(true); for (GitSCMExtension ext : scm.getExtensions()) ext.decorateCheckoutCommand(scm, build, git, listener, checkoutCommand); checkoutCommand.execute();
private void checkout(GitSCM scm, Run<?, ?> build, GitClient git, TaskListener listener, Revision rev) throws InterruptedException, IOException, GitException { CheckoutCommand checkoutCommand = git.checkout().ref(rev.getSha1String()); for (GitSCMExtension ext : scm.getExtensions()) { ext.decorateCheckoutCommand(scm, build, git, listener, checkoutCommand); } checkoutCommand.execute(); } }
/** * {@inheritDoc} */ @Override @Deprecated public void decorateCheckoutCommand(GitSCM scm, AbstractBuild<?, ?> build, GitClient git, BuildListener listener, CheckoutCommand cmd) throws IOException, InterruptedException, GitException { cmd.timeout(timeout); }
CheckoutCommand checkoutCommand = git.checkout().branch(localBranchName).ref(revToBuild.revision.getSha1String()).deleteBranchIfExist(true); for (GitSCMExtension ext : this.getExtensions()) { ext.decorateCheckoutCommand(this, build, git, listener, checkoutCommand); checkoutCommand.execute(); } catch (GitLockFailedException e) {