changeset 109251:e60e30383efd

Fix reading file names in Git annotate buffers. * lisp/vc-git.el (vc-git-annotate-extract-revision-at-line): Remove trailing whitespace. Suggested by Eric Hanchrow. (Bug#6481)
author Dan Nicolaescu <dann@ics.uci.edu>
date Mon, 21 Jun 2010 13:03:30 -0700
parents d3b4a3311253
children 64f9d1b2b73b
files lisp/ChangeLog lisp/vc-git.el
diffstat 2 files changed, 12 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/lisp/ChangeLog	Sun Jun 20 12:30:27 2010 -0400
+++ b/lisp/ChangeLog	Mon Jun 21 13:03:30 2010 -0700
@@ -1,3 +1,9 @@
+2010-06-21  Dan Nicolaescu  <dann@ics.uci.edu>
+
+	Fix reading file names in Git annotate buffers.
+	* vc-git.el (vc-git-annotate-extract-revision-at-line): Remove
+	trailing whitespace.  Suggested by Eric Hanchrow.  (Bug#6481)
+
 2010-06-20  Alan Mackenzie  <acm@muc.de>
 
 	* progmodes/cc-mode.el (c-before-hack-hook): When the mode is set
--- a/lisp/vc-git.el	Sun Jun 20 12:30:27 2010 -0400
+++ b/lisp/vc-git.el	Mon Jun 21 13:03:30 2010 -0700
@@ -706,8 +706,12 @@
     (when (looking-at "\\([0-9a-f^][0-9a-f]+\\) \\(\\([^(]+\\) \\)?")
       (let ((revision (match-string-no-properties 1)))
 	(if (match-beginning 2)
-	    (cons revision (expand-file-name (match-string-no-properties 3)
-					     (vc-git-root default-directory)))
+	    (let ((fname (match-string-no-properties 3)))
+	      ;; Remove trailing whitespace from the file name.
+	      (when (string-match " +\\'" fname)
+		(setq fname (substring fname 0 (match-beginning 0))))
+	      (cons revision
+		    (expand-file-name fname (vc-git-root default-directory))))
 	  revision)))))
 
 ;;; TAG SYSTEM