]> git.eshelyaron.com Git - emacs.git/commitdiff
Fix Git revision navigation in currently removed directories
authorDmitry Gutov <dgutov@yandex.ru>
Sun, 30 Apr 2017 16:25:23 +0000 (19:25 +0300)
committerDmitry Gutov <dgutov@yandex.ru>
Mon, 1 May 2017 01:30:01 +0000 (04:30 +0300)
* lisp/vc/vc-git.el (vc-git-next-revision): Use the repo root as
default-directory because FILE's parent directory might not exist
anymore (bug#26345).

lisp/vc/vc-git.el

index 1a3f1bf2f48ef8588324a95424c9a8e55865a07b..4767cbf88c62a4b546498d8fbcb5dc094f81dfd1 100644 (file)
@@ -1274,9 +1274,8 @@ This requires git 1.8.4 or later, for the \"-L\" option of \"git log\"."
 
 (defun vc-git-next-revision (file rev)
   "Git-specific version of `vc-next-revision'."
-  (let* ((default-directory (file-name-directory
-                            (expand-file-name file)))
-         (file (file-name-nondirectory file))
+  (let* ((default-directory (vc-git-root file))
+         (file (file-relative-name file))
          (current-rev
           (with-temp-buffer
             (and