@matheusbsbs / matheus-bagliano / commits / 8fdc39729b
Fork 0

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>

Alexandre Julliard committed Aug 11, 2007 at 12:23 UTC 8fdc39729b9aaa02e89eca9d7964182a72052665
1 file changed +6 -4
contrib/emacs/git.el
+6 -4
@@ -912,10 +912,12 @@ Return the list of files that haven't been handled."
912
913 (defun git-setup-diff-buffer (buffer)
914 "Setup a buffer for displaying a diff."
915 - (with-current-buffer buffer
916 - (diff-mode)
917 - (goto-char (point-min))
918 - (setq buffer-read-only t))
915 + (let ((dir default-directory))
916 + (with-current-buffer buffer
917 + (diff-mode)
918 + (goto-char (point-min))
919 + (setq default-directory dir)
920 + (setq buffer-read-only t)))
921 (display-buffer buffer)
922 (shrink-window-if-larger-than-buffer))
923