use of git4idea.commands.GitLineHandlerListener in project intellij-community by JetBrains.
the class GitCheckoutProvider method doClone.
public static boolean doClone(@NotNull Project project, @NotNull Git git, @NotNull String directoryName, @NotNull String parentDirectory, @NotNull String sourceRepositoryURL) {
ProgressIndicator indicator = ProgressManager.getInstance().getProgressIndicator();
indicator.setIndeterminate(false);
GitLineHandlerListener progressListener = GitStandardProgressAnalyzer.createListener(indicator);
GitCommandResult result = git.clone(project, new File(parentDirectory), sourceRepositoryURL, directoryName, progressListener);
if (result.success()) {
return true;
}
VcsNotifier.getInstance(project).notifyError("Clone failed", result.getErrorOutputAsHtmlString());
return false;
}
use of git4idea.commands.GitLineHandlerListener in project intellij-community by JetBrains.
the class GitPushOperation method doPush.
@NotNull
private ResultWithOutput doPush(@NotNull GitRepository repository, @NotNull PushSpec<GitPushSource, GitPushTarget> pushSpec) {
GitPushTarget target = pushSpec.getTarget();
GitLocalBranch sourceBranch = pushSpec.getSource().getBranch();
GitRemoteBranch targetBranch = target.getBranch();
GitLineHandlerListener progressListener = GitStandardProgressAnalyzer.createListener(myProgressIndicator);
boolean setUpstream = pushSpec.getTarget().isNewBranchCreated() && !branchTrackingInfoIsSet(repository, sourceBranch);
String tagMode = myTagMode == null ? null : myTagMode.getArgument();
String spec = sourceBranch.getFullName() + ":" + targetBranch.getNameForRemoteOperations();
GitCommandResult res = myGit.push(repository, targetBranch.getRemote(), spec, myForce, setUpstream, tagMode, progressListener);
return new ResultWithOutput(res);
}
Aggregations