check for the current branch before switching buffer

The wazzup buffer might already exist, so if we look at the branch
name in it, it might refer to another branch, even another repository.
This commit is contained in:
Rémi Vanicat 2010-03-28 17:04:35 +02:00 committed by Phil Jackson
parent 7c80c10199
commit 82b8d93731

View file

@ -3361,11 +3361,12 @@ Prefix arg means justify as well."
(defun magit-wazzup (&optional all)
(interactive "P")
(let* ((topdir (magit-get-top-dir default-directory)))
(let ((topdir (magit-get-top-dir default-directory))
(current-branch (magit-get-current-branch)))
(switch-to-buffer "*magit-wazzup*")
(magit-mode-init topdir 'wazzup
#'magit-refresh-wazzup-buffer
(magit-get-current-branch) all)))
current-branch all)))
;;; Miscellaneous