From 0cd0aaa14fc4b2279d3d8bb8afe0aaa647c8f272 Mon Sep 17 00:00:00 2001 From: Sean Whitton Date: Sun, 31 Aug 2025 16:37:11 +0100 Subject: [PATCH] vc-revert: Fix calling vc-buffer-sync (bug#79319) * lisp/vc/vc.el (vc-revert): Don't call vc-buffer-sync on a non-file-visiting buffer (bug#79319). Don't try to use memq to compare strings. --- lisp/vc/vc.el | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lisp/vc/vc.el b/lisp/vc/vc.el index 76ba024c209..229ec112bed 100644 --- a/lisp/vc/vc.el +++ b/lisp/vc/vc.el @@ -3664,7 +3664,8 @@ to the working revision (except for keyword expansion)." ;; If any of the files is visited by the current buffer, make sure ;; buffer is saved. If the user says `no', abort since we cannot ;; show the changes and ask for confirmation to discard them. - (when (or (not files) (memq (buffer-file-name) files)) + (when-let* ((n (buffer-file-name)) + ((or (not files) (member n files)))) (vc-buffer-sync nil)) (save-some-buffers nil (lambda () (and-let* ((n (buffer-file-name)))