diff options
author | Dan Nicolaescu <[email protected]> | 2010-06-21 13:03:30 -0700 |
---|---|---|
committer | Dan Nicolaescu <[email protected]> | 2010-06-21 13:03:30 -0700 |
commit | c036381c22255c48bf71cc2f58bb1f061a801523 (patch) | |
tree | 636b85ccfd9b9a3f748a8e9e15cdcc6a6c60504a | |
parent | 0fc76035edd207f6c87b4802bce9fa16d9c857d2 (diff) |
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)
-rw-r--r-- | lisp/ChangeLog | 6 | ||||
-rw-r--r-- | lisp/vc-git.el | 8 |
2 files changed, 12 insertions, 2 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 47763f3c70..9cb50c3e98 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,3 +1,9 @@ +2010-06-21 Dan Nicolaescu <[email protected]> + + 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 <[email protected]> * 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 dec54796c5..058929632e 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 |