From: Juri Linkov Date: Tue, 24 Jan 2023 18:48:20 +0000 (+0200) Subject: Handle relative file names in vc-resynch-window and vc-resynch-buffer X-Git-Tag: emacs-29.0.90~609 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=ecf500b5e34f3767df6b41f110efcf307c74ebc9;p=emacs.git Handle relative file names in vc-resynch-window and vc-resynch-buffer * lisp/vc/vc-dispatcher.el (vc-resynch-window, vc-resynch-buffer): While comparing with `buffer-file-name' if `file' is not absolute use `expand-file-name' in `vc-root-dir'. This fixes the case of refreshing the buffers after typing `C-x v = C-x v u' (bug#60897). --- diff --git a/lisp/vc/vc-dispatcher.el b/lisp/vc/vc-dispatcher.el index e1a3eff448d..fd5f655a0f6 100644 --- a/lisp/vc/vc-dispatcher.el +++ b/lisp/vc/vc-dispatcher.el @@ -608,7 +608,10 @@ reverting. NOQUERY should be t *only* if it is known the only difference between the buffer and the file is due to modifications by the dispatcher client code, rather than user editing!" - (and (string= buffer-file-name file) + (and (string= buffer-file-name + (if (file-name-absolute-p file) + file + (expand-file-name file (vc-root-dir)))) (if keep (when (file-exists-p file) (when reset-vc-info @@ -643,7 +646,10 @@ editing!" (defun vc-resynch-buffer (file &optional keep noquery reset-vc-info) "If FILE is currently visited, resynch its buffer." - (if (string= buffer-file-name file) + (if (string= buffer-file-name + (if (file-name-absolute-p file) + file + (expand-file-name file (vc-root-dir)))) (vc-resynch-window file keep noquery reset-vc-info) (if (file-directory-p file) (vc-resynch-buffers-in-directory file keep noquery reset-vc-info)