aboutsummaryrefslogtreecommitdiffstats
path: root/contrib/emacs/git.el
diff options
context:
space:
mode:
authorAlexandre Julliard <julliard@winehq.org>2007-08-11 12:23:21 +0200
committerJunio C Hamano <gitster@pobox.com>2007-08-13 12:58:38 -0700
commit8fdc39729b9aaa02e89eca9d7964182a72052665 (patch)
treead966203774f39d13611472b5730480a876724e7 /contrib/emacs/git.el
parent09afcd6933e8497c997205dda71d718e62b4de62 (diff)
downloadgit-8fdc39729b9aaa02e89eca9d7964182a72052665.tar.gz
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>
Diffstat (limited to 'contrib/emacs/git.el')
-rw-r--r--contrib/emacs/git.el10
1 files changed, 6 insertions, 4 deletions
diff --git a/contrib/emacs/git.el b/contrib/emacs/git.el
index 214b75cf93..be44e06c45 100644
--- a/contrib/emacs/git.el
+++ b/contrib/emacs/git.el
@@ -912,10 +912,12 @@ Return the list of files that haven't been handled."
(defun git-setup-diff-buffer (buffer)
"Setup a buffer for displaying a diff."
- (with-current-buffer buffer
- (diff-mode)
- (goto-char (point-min))
- (setq buffer-read-only t))
+ (let ((dir default-directory))
+ (with-current-buffer buffer
+ (diff-mode)
+ (goto-char (point-min))
+ (setq default-directory dir)
+ (setq buffer-read-only t)))
(display-buffer buffer)
(shrink-window-if-larger-than-buffer))