emacs-diffs
[Top][All Lists]
Advanced

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

[Emacs-diffs] /srv/bzr/emacs/emacs-23 r99871: Fix reading file names in


From: Dan Nicolaescu
Subject: [Emacs-diffs] /srv/bzr/emacs/emacs-23 r99871: Fix reading file names in Git annotate buffers.
Date: Mon, 21 Jun 2010 13:03:30 -0700
User-agent: Bazaar (2.0.3)

------------------------------------------------------------
revno: 99871
committer: Dan Nicolaescu <address@hidden>
branch nick: emacs-23
timestamp: Mon 2010-06-21 13:03:30 -0700
message:
  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)
modified:
  lisp/ChangeLog
  lisp/vc-git.el
=== modified file 'lisp/ChangeLog'
--- a/lisp/ChangeLog    2010-06-20 16:17:05 +0000
+++ b/lisp/ChangeLog    2010-06-21 20:03:30 +0000
@@ -1,3 +1,9 @@
+2010-06-21  Dan Nicolaescu  <address@hidden>
+
+       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  <address@hidden>
 
        * progmodes/cc-mode.el (c-before-hack-hook): When the mode is set

=== modified file 'lisp/vc-git.el'
--- a/lisp/vc-git.el    2010-04-16 02:45:26 +0000
+++ b/lisp/vc-git.el    2010-06-21 20:03:30 +0000
@@ -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


reply via email to

[Prev in Thread] Current Thread [Next in Thread]