From 8bf8a36db64afa48cf3e55d2ac84b50ff48a5226 Mon Sep 17 00:00:00 2001 From: Phil Jackson Date: Thu, 6 May 2010 00:27:20 +0100 Subject: [PATCH] Use `magit-section-case' to get branch from wazzup. --- magit.el | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/magit.el b/magit.el index a76c9eed..9dbf5d79 100644 --- a/magit.el +++ b/magit.el @@ -2558,9 +2558,10 @@ Fails if working tree or staging area contain uncommitted changes. ;;; Merging (defun magit-guess-branch () - (let ((sec (magit-current-section))) - (if (and sec (eq (magit-section-type sec) 'wazzup)) - (magit-section-info sec)))) + (magit-section-case (item info) + ((wazzup commit) + (magit-section-info (magit-section-parent item))) + ((wazzup) info))) (defun magit-manual-merge (rev) "Merge REVISION into the current 'HEAD'; leave changes uncommitted.