Removing a duplicate switch-to-buffer

We don't need to change buffer twice when we use a new buffer
This commit is contained in:
Rémi Vanicat 2010-05-26 17:09:35 +02:00
parent 3bdaf275db
commit 0bb2e4c86f

View file

@ -2495,11 +2495,10 @@ insert a line to tell how to insert more of them"
(setq topdir (magit-get-top-dir dir)))) (setq topdir (magit-get-top-dir dir))))
(when topdir (when topdir
(let ((buf (or (magit-find-buffer 'status topdir) (let ((buf (or (magit-find-buffer 'status topdir)
(switch-to-buffer (get-buffer-create
(get-buffer-create (concat "*magit: "
(concat "*magit: " (file-name-nondirectory
(file-name-nondirectory (directory-file-name topdir)) "*")))))
(directory-file-name topdir)) "*"))))))
(switch-to-buffer buf) (switch-to-buffer buf)
(magit-mode-init topdir 'status #'magit-refresh-status) (magit-mode-init topdir 'status #'magit-refresh-status)
(magit-status-mode t))))) (magit-status-mode t)))))