git.el: Always set the current directory in the git-diff buffer.
This allows jumping to the correct file with the diff-mode commands. Signed-off-by: Alexandre Julliard <julliard@winehq.org> Signed-off-by: Junio C Hamano <gitster@pobox.com>
This commit is contained in:
parent
09afcd6933
commit
8fdc39729b
@ -912,10 +912,12 @@ Return the list of files that haven't been handled."
|
|||||||
|
|
||||||
(defun git-setup-diff-buffer (buffer)
|
(defun git-setup-diff-buffer (buffer)
|
||||||
"Setup a buffer for displaying a diff."
|
"Setup a buffer for displaying a diff."
|
||||||
|
(let ((dir default-directory))
|
||||||
(with-current-buffer buffer
|
(with-current-buffer buffer
|
||||||
(diff-mode)
|
(diff-mode)
|
||||||
(goto-char (point-min))
|
(goto-char (point-min))
|
||||||
(setq buffer-read-only t))
|
(setq default-directory dir)
|
||||||
|
(setq buffer-read-only t)))
|
||||||
(display-buffer buffer)
|
(display-buffer buffer)
|
||||||
(shrink-window-if-larger-than-buffer))
|
(shrink-window-if-larger-than-buffer))
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user