private PullCommand pullCommand(String branch, Git git) { if (Strings.isNullOrEmpty(branch)) { return buildCommand(git.pull()); } return buildCommand(git.pull().setRemoteBranchName(branch)).setTimeout(GIT_TRANS_TIMEOUT); }
command.setTimeout(timeout.toInteger());
@Override public PullResult pull(final Git git, final int timeout) throws GitAPIException { PullCommand pull = git.pull(); if (timeout >= 0) pull.setTimeout(timeout); pull.setProgressMonitor(new TextProgressMonitor()); PullResult result = pull.call(); return result; }
private Git pullRepository(final File workingDir) throws GitAPIException, IOException { final Git git = Git.open(workingDir); git.pull().setProgressMonitor(PROGRESS_MONITOR) .setRebase(true) .setCredentialsProvider(user) .setTimeout(pullPushTimeoutSeconds) .call(); return git; }
private Git pullRepository(final File workingDir) throws GitAPIException, IOException { final Git git = Git.open(workingDir); git.pull().setProgressMonitor(PROGRESS_MONITOR) .setRebase(true) .setCredentialsProvider(user) .setTimeout(pullPushTimeoutSeconds) .call(); return git; }
tacGitlabProperties.getPassword())).setTimeout(30);
tacGitlabProperties.getPassword())).setTimeout(30);
@Override public Void call() { try { final PullResult result = gitProctorCore.getGit() .pull() .setProgressMonitor(PROGRESS_MONITOR) .setRebase(true) .setCredentialsProvider(user) .setTimeout(GitProctorUtils.DEFAULT_GIT_PULL_PUSH_TIMEOUT_SECONDS) .call(); if (!result.isSuccessful()) { /** if git pull failed, use git reset **/ gitProctorCore.undoLocalChanges(); } } catch (final Exception e) { LOGGER.error("Error when refreshing git directory " + getDirectoryPath(), e); } return null; } });
@Override public Void call() { try { final PullResult result = gitProctorCore.getGit() .pull() .setProgressMonitor(PROGRESS_MONITOR) .setRebase(true) .setCredentialsProvider(user) .setTimeout(GitProctorUtils.DEFAULT_GIT_PULL_PUSH_TIMEOUT_SECONDS) .call(); if (!result.isSuccessful()) { /** if git pull failed, use git reset **/ gitProctorCore.undoLocalChanges(); } } catch (final Exception e) { LOGGER.error("Error when refreshing git directory " + getDirectoryPath(), e); } return null; } });
.setRebase(true) .setCredentialsProvider(user) .setTimeout(pullPushTimeoutSeconds) .call(); if (!pullResult.isSuccessful()) {
.setRebase(true) .setCredentialsProvider(user) .setTimeout(pullPushTimeoutSeconds) .call(); if (!pullResult.isSuccessful()) {