diff --git a/plugins/git4idea/src/git4idea/actions/GitPull.java b/plugins/git4idea/src/git4idea/actions/GitPull.java index b460f03c24aa..f9147d8ce246 100644 --- a/plugins/git4idea/src/git4idea/actions/GitPull.java +++ b/plugins/git4idea/src/git4idea/actions/GitPull.java @@ -31,17 +31,14 @@ import git4idea.commands.GitStandardProgressAnalyzer; import git4idea.commands.GitTask; import git4idea.commands.GitTaskResultHandlerAdapter; import git4idea.i18n.GitBundle; -import git4idea.jgit.GitHttpAdapter; import git4idea.merge.GitMergeUtil; import git4idea.merge.GitPullDialog; import git4idea.repo.GitRemote; import git4idea.repo.GitRepository; import git4idea.repo.GitRepositoryManager; -import git4idea.update.GitFetcher; import git4idea.util.GitUIUtil; import org.jetbrains.annotations.NotNull; -import java.util.Collections; import java.util.List; import java.util.Set; import java.util.concurrent.atomic.AtomicReference; @@ -86,18 +83,8 @@ public class GitPull extends GitRepositoryAction { return; } - if (GitHttpAdapter.shouldUseJGit(url)) { - boolean fetchSuccessful = new GitFetcher(project, indicator, true).fetchRootsAndNotify(Collections.singleton(repository), - "Pull failed", false); - if (!fetchSuccessful) { - return; - } - handlerReference.set(dialog.pullOrMergeHandler(null)); - } else { - handlerReference.set(dialog.pullOrMergeHandler(url)); - } - - + handlerReference.set(dialog.makeHandler(url)); + final VirtualFile root = dialog.gitRoot(); affectedRoots.add(root); String revision = repository.getCurrentRevision(); diff --git a/plugins/git4idea/src/git4idea/merge/GitPullDialog.java b/plugins/git4idea/src/git4idea/merge/GitPullDialog.java index cd1bfa1aded1..446c3bb6d0e5 100644 --- a/plugins/git4idea/src/git4idea/merge/GitPullDialog.java +++ b/plugins/git4idea/src/git4idea/merge/GitPullDialog.java @@ -153,15 +153,12 @@ public class GitPullDialog extends DialogWrapper { /** * @return a pull handler configured according to dialog options */ - public GitLineHandler pullOrMergeHandler(@Nullable String url) { - boolean pull = url != null; - GitLineHandler h = new GitLineHandler(myProject, gitRoot(), pull ? GitCommand.PULL : GitCommand.MERGE); + public GitLineHandler makeHandler(@NotNull String url) { + GitLineHandler h = new GitLineHandler(myProject, gitRoot(), GitCommand.PULL); // ignore merge failure for the pull h.ignoreErrorCode(1); - if (pull) { - h.setRemoteProtocol(url); - h.addProgressParameter(); - } + h.setRemoteProtocol(url); + h.addProgressParameter(); h.addParameters("--no-stat"); if (myNoCommitCheckBox.isSelected()) { h.addParameters("--no-commit"); @@ -182,24 +179,15 @@ public class GitPullDialog extends DialogWrapper { h.addParameters("--strategy", strategy); } h.addParameters("-v"); - if (pull) { - h.addProgressParameter(); - } + h.addProgressParameter(); final List markedBranches = myBranchChooser.getMarkedElements(); String remote = getRemote(); LOG.assertTrue(remote != null, "Selected remote can't be null here."); - if (pull) { - // git pull origin master (remote branch name in the format local to that remote) - h.addParameters(remote); - for (String branch : markedBranches) { - h.addParameters(removeRemotePrefix(branch, remote)); - } - } else { - // git merge origin/master (remote branch name in format of this repository) - for (String branch : markedBranches) { - h.addParameters(branch); - } + // git pull origin master (remote branch name in the format local to that remote) + h.addParameters(remote); + for (String branch : markedBranches) { + h.addParameters(removeRemotePrefix(branch, remote)); } return h; }