Commit fd40b3a9 authored by Jonas Bernoulli's avatar Jonas Bernoulli

magit-pull-from-upstream: don't explicitly specify remote branch

Previously we used `git pull REMOTE BRANCH' and now we just use `git
pull REMOTE'.  This has the advantage that tags that point to commits
which are being pulled are also fetched.  Users have come to expect
that behavior.

We did not do this previously because I considered it to be unsafe.
The documentation of `git push [REMOTE]' claims that it pushes to the
upstream and fails to mention the various variables that can cause it
to push somewhere else.  The documentation of `git pull [REMOTE]' also
does not mention any such variables, but as the push documentation
demonstrates, this is no guarantee that there are none.  On the other
hand, unlike with pull, I am not actually aware of any such variables.

I have decided to drop the BRANCH argument because accidentally pulling
something different from what one wanted to pull, is much less dangerous
than accidentally pushing to the wrong place.
parent 1c28c17f
......@@ -366,7 +366,9 @@ missing. To add them use something like:
"Pull from the upstream of the current branch."
(interactive (list (magit-pull-arguments)))
(--if-let (magit-get-upstream-branch)
(magit-git-pull it args)
(progn (run-hooks 'magit-credential-hook)
(magit-run-git-with-editor
"pull" args (car (magit-split-branch-name it))))
(--if-let (magit-get-current-branch)
(user-error "No upstream is configured for %s" it)
(user-error "No branch is checked out"))))
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment