From af736528b9efaabc52b2599d9ced3aed964a07c3 Mon Sep 17 00:00:00 2001 From: Dmitry Gutov Date: Sun, 30 Apr 2017 19:25:23 +0300 Subject: [PATCH] Fix Git revision navigation in currently removed directories * 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 | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/lisp/vc/vc-git.el b/lisp/vc/vc-git.el index 1a3f1bf2f48..4767cbf88c6 100644 --- a/lisp/vc/vc-git.el +++ b/lisp/vc/vc-git.el @@ -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 -- 2.39.5