]> git.eshelyaron.com Git - emacs.git/commitdiff
Fix reading file names in Git annotate buffers.
authorDan Nicolaescu <dann@ics.uci.edu>
Mon, 21 Jun 2010 20:03:30 +0000 (13:03 -0700)
committerDan Nicolaescu <dann@ics.uci.edu>
Mon, 21 Jun 2010 20:03:30 +0000 (13:03 -0700)
* lisp/vc-git.el (vc-git-annotate-extract-revision-at-line): Remove
trailing whitespace.  Suggested by Eric Hanchrow.  (Bug#6481)

lisp/ChangeLog
lisp/vc-git.el

index 47763f3c705518d2d51acbebce69189c07285ef2..9cb50c3e98aefe99527ac75875cef0533bd648f0 100644 (file)
@@ -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
index dec54796c5b1c05fbfe6636bf53d7556f762108d..058929632e9487e20b673798782976d08188f01e 100644 (file)
@@ -706,8 +706,12 @@ or BRANCH^ (where \"^\" can be repeated)."
     (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