]> git.eshelyaron.com Git - emacs.git/commitdiff
vc-finish-logentry: Fix syncing buffers: include whole fileset
authorSean Whitton <spwhitton@spwhitton.name>
Thu, 12 Jun 2025 10:15:56 +0000 (11:15 +0100)
committerEshel Yaron <me@eshelyaron.com>
Wed, 18 Jun 2025 08:12:08 +0000 (10:12 +0200)
* lisp/vc/vc-dispatcher.el (log-edit-vc-backend)
(vc-buffer-sync-fileset): Declare.
(vc-finish-logentry): Call vc-buffer-sync-fileset instead of
just vc-buffer-sync.

(cherry picked from commit 651d4b11bcf227cd2f33bca0af5a5710101e9b39)

lisp/vc/vc-dispatcher.el

index 5cc2dd9ade90046fc5a9bce214eec8d84f813ec5..17d73ca49779390b365abb0a03549cb67bd98631 100644 (file)
@@ -847,6 +847,9 @@ DIFF-FUNCTION is `log-edit-diff-function' for the Log Edit buffer."
                  msg)
       (vc-finish-logentry (eq comment t)))))
 
+(defvar log-edit-vc-backend)
+(declare-function vc-buffer-sync-fileset "vc")
+
 ;; vc-finish-logentry is typically called from a log-edit buffer (see
 ;; vc-start-logentry).
 (defun vc-finish-logentry (&optional nocomment)
@@ -858,10 +861,9 @@ the buffer contents as a comment."
   ;; Check and record the comment, if any.
   (unless nocomment
     (run-hooks 'vc-logentry-check-hook))
-  ;; Sync parent buffer in case the user modified it while editing the comment.
-  ;; But not if it is a vc-dir buffer.
-  (with-current-buffer vc-parent-buffer
-    (or (vc-dispatcher-browsing) (vc-buffer-sync)))
+  ;; Must pass NOT-ESSENTIAL nil because we later call
+  ;; `vc-resynch-buffer' with NOQUERY non-nil.
+  (vc-buffer-sync-fileset (list log-edit-vc-backend vc-log-fileset))
   (unless vc-log-operation
     (error "No log operation is pending"))