Skip to content

Commit

Permalink
git.el: Set default directory before running the status mode setup ho…
Browse files Browse the repository at this point in the history
…oks.

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>
  • Loading branch information
Alexandre Julliard authored and Junio C Hamano committed Mar 4, 2006
1 parent 18e3e99 commit a944652
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion contrib/emacs/git.el
Original file line number Diff line number Diff line change
Expand Up @@ -943,6 +943,7 @@ Commands:
(erase-buffer)
(let ((status (ewoc-create 'git-fileinfo-prettyprint "" "")))
(set (make-local-variable 'git-status) status))
(set (make-local-variable 'list-buffers-directory) default-directory)
(run-hooks 'git-status-mode-hook)))

(defun git-status (dir)
Expand All @@ -952,8 +953,8 @@ Commands:
(if (file-directory-p (concat (file-name-as-directory dir) ".git"))
(let ((buffer (create-file-buffer (expand-file-name "*git-status*" dir))))
(switch-to-buffer buffer)
(git-status-mode)
(cd dir)
(git-status-mode)
(git-refresh-status)
(goto-char (point-min)))
(message "%s is not a git working tree." dir)))
Expand Down

0 comments on commit a944652

Please sign in to comment.