[PATCH] git.el: Always set the current directory in the git-diff buffer.

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



This allows jumping to the correct file with the diff-mode commands.

Signed-off-by: Alexandre Julliard <julliard@xxxxxxxxxx>
---
 contrib/emacs/git.el |   10 ++++++----
 1 files changed, 6 insertions(+), 4 deletions(-)

diff --git a/contrib/emacs/git.el b/contrib/emacs/git.el
index 214b75c..be44e06 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))
 
-- 
1.5.3.rc4.70.gf909

-- 
Alexandre Julliard
julliard@xxxxxxxxxx
-
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]

  Powered by Linux