vc-setup-buffer: Don't set current buffer as parent (bug#59457)

* lisp/vc/vc-dispatcher.el (vc-setup-buffer): Don't set the
current buffer as parent (bug#59457).
This commit is contained in:
Sean Whitton 2025-03-10 17:13:14 +08:00
parent e09a80143d
commit 6d62a293af

View file

@ -189,9 +189,12 @@ Another is that undo information is not kept."
;; Kill also this permanent local var in case the VC command that
;; created BUF was invoked from a different directory (bug#44698).
(kill-local-variable 'file-local-variables-alist)
(setq-local vc-parent-buffer camefrom)
(setq-local vc-parent-buffer-name
(concat " from " (buffer-name camefrom)))
;; If we are refreshing an existing view,
;; don't throw away where we really came from (bug#59457).
(unless (eq camefrom (current-buffer))
(setq-local vc-parent-buffer camefrom)
(setq-local vc-parent-buffer-name
(concat " from " (buffer-name camefrom))))
(setq default-directory olddir)
(let ((buffer-undo-list t)
(inhibit-read-only t))