Subject: `vc-git-annotate-extract-revision-at-line' returns incorrect pathname

From: Štěpán Němec <[email-masked]>
Date: Sun, 28 Feb 2010 15:57:58 +0100

Hello,

I spotted this when running `vc-annotate-show-diff-revision-at-line', which
called the above-mentioned fuction in this case.

Incorrect path is returned when not called from the repository root, because
the value of `default-directory' (used by `expand-file-name') will be
different (i.e. the current directory deeper in the tree, instead of the
root dir).

The patch below (based on the latest Git master) fixes it.

Regards,

 Štěpán Němec

--- a/lisp/vc-git.el
+++ b/lisp/vc-git.el
@@ -668,7 +668,9 @@ 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)))
+	  (cons revision (expand-file-name
+                          (match-string-no-properties 3)
+                          (vc-git-root default-directory)))
	  revision)))))

;;; TAG SYSTEM