aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSean Whitton2025-08-31 16:37:11 +0100
committerSean Whitton2025-08-31 16:37:11 +0100
commit0cd0aaa14fc4b2279d3d8bb8afe0aaa647c8f272 (patch)
treee8dc6e916f7718382621ca0c3a6244bcabcb6a55
parent11dc1420e449dd936e31d77fe445cb7abac88fb8 (diff)
downloademacs-0cd0aaa14fc4b2279d3d8bb8afe0aaa647c8f272.tar.gz
emacs-0cd0aaa14fc4b2279d3d8bb8afe0aaa647c8f272.zip
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.
-rw-r--r--lisp/vc/vc.el3
1 files changed, 2 insertions, 1 deletions
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)."
3664 ;; If any of the files is visited by the current buffer, make sure 3664 ;; If any of the files is visited by the current buffer, make sure
3665 ;; buffer is saved. If the user says `no', abort since we cannot 3665 ;; buffer is saved. If the user says `no', abort since we cannot
3666 ;; show the changes and ask for confirmation to discard them. 3666 ;; show the changes and ask for confirmation to discard them.
3667 (when (or (not files) (memq (buffer-file-name) files)) 3667 (when-let* ((n (buffer-file-name))
3668 ((or (not files) (member n files))))
3668 (vc-buffer-sync nil)) 3669 (vc-buffer-sync nil))
3669 (save-some-buffers nil (lambda () 3670 (save-some-buffers nil (lambda ()
3670 (and-let* ((n (buffer-file-name))) 3671 (and-let* ((n (buffer-file-name)))