git.el: Set default directory before running the status mode setup hooks.

Also set the list-buffers-directory variable for nicer buffer list
display.

Signed-off-by: Alexandre Julliard <julliard@winehq.org>
Signed-off-by: Junio C Hamano <junkio@cox.net>
This commit is contained in:
Alexandre Julliard 2006-03-04 17:38:05 +01:00 committed by Junio C Hamano
parent 18e3e99e3d
commit a944652c05

View File

@ -943,6 +943,7 @@ Commands:
(erase-buffer) (erase-buffer)
(let ((status (ewoc-create 'git-fileinfo-prettyprint "" ""))) (let ((status (ewoc-create 'git-fileinfo-prettyprint "" "")))
(set (make-local-variable 'git-status) status)) (set (make-local-variable 'git-status) status))
(set (make-local-variable 'list-buffers-directory) default-directory)
(run-hooks 'git-status-mode-hook))) (run-hooks 'git-status-mode-hook)))
(defun git-status (dir) (defun git-status (dir)
@ -952,8 +953,8 @@ Commands:
(if (file-directory-p (concat (file-name-as-directory dir) ".git")) (if (file-directory-p (concat (file-name-as-directory dir) ".git"))
(let ((buffer (create-file-buffer (expand-file-name "*git-status*" dir)))) (let ((buffer (create-file-buffer (expand-file-name "*git-status*" dir))))
(switch-to-buffer buffer) (switch-to-buffer buffer)
(git-status-mode)
(cd dir) (cd dir)
(git-status-mode)
(git-refresh-status) (git-refresh-status)
(goto-char (point-min))) (goto-char (point-min)))
(message "%s is not a git working tree." dir))) (message "%s is not a git working tree." dir)))