branch: elpa/magit
commit d1882ac9d013d29a3c99e006d674a49e8eb85865
Author: Jonas Bernoulli <jo...@bernoul.li>
Commit: Jonas Bernoulli <jo...@bernoul.li>

    magit-get-local-upstream-branch: New function
---
 lisp/magit-git.el   | 5 +++++
 lisp/magit-merge.el | 4 +---
 2 files changed, 6 insertions(+), 3 deletions(-)

diff --git a/lisp/magit-git.el b/lisp/magit-git.el
index 3b311cb0a2..abd8f2b132 100644
--- a/lisp/magit-git.el
+++ b/lisp/magit-git.el
@@ -1716,6 +1716,11 @@ according to the branch type."
                     'magit-branch-local
                   'magit-branch-remote)))))
 
+(defun magit-get-local-upstream-branch (&optional branch)
+  (and-let* ((upstream (magit-get-upstream-branch branch))
+             (upstream (cdr (magit-split-branch-name upstream))))
+    (and (magit-branch-p upstream) upstream)))
+
 (defun magit-get-indirect-upstream-branch (branch &optional force)
   (let ((remote (magit-get "branch" branch "remote")))
     (and remote (not (equal remote "."))
diff --git a/lisp/magit-merge.el b/lisp/magit-merge.el
index 2d82ceeda1..e00c15761e 100644
--- a/lisp/magit-merge.el
+++ b/lisp/magit-merge.el
@@ -144,9 +144,7 @@ then also remove the respective remote branch."
                   (or (magit-get-current-branch)
                       (magit-rev-parse "HEAD")))
           nil
-          (and-let* ((upstream (magit-get-upstream-branch))
-                     (upstream (cdr (magit-split-branch-name upstream))))
-            (and (magit-branch-p upstream) upstream)))
+          (magit-get-local-upstream-branch))
          (magit-merge-arguments)))
   (let ((current (magit-get-current-branch))
         (head (magit-rev-parse "HEAD")))

Reply via email to