From: Dan Nicolaescu Date: Mon, 21 Jun 2010 20:03:30 +0000 (-0700) Subject: Fix reading file names in Git annotate buffers. X-Git-Tag: emacs-pretest-23.2.90~139^2~111 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=c036381c22255c48bf71cc2f58bb1f061a801523;p=emacs.git 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) --- diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 47763f3c705..9cb50c3e98a 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,3 +1,9 @@ +2010-06-21 Dan Nicolaescu + + 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 * progmodes/cc-mode.el (c-before-hack-hook): When the mode is set diff --git a/lisp/vc-git.el b/lisp/vc-git.el index dec54796c5b..058929632e9 100644 --- a/lisp/vc-git.el +++ b/lisp/vc-git.el @@ -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