Fix Bug#34196

* lisp/net/tramp.el (tramp-process-actions): Disable `global-auto-revert-mode'
temporarily.  (Bug#34196)
This commit is contained in:
Michael Albinus 2019-02-04 16:03:43 +01:00
parent 7cdf4004c8
commit d6f430cb88

View file

@ -4060,17 +4060,23 @@ performed successfully. Any other value means an error."
(save-restriction
(with-tramp-progress-reporter
proc 3 "Waiting for prompts from remote shell"
(let (exit)
(if timeout
(with-timeout (timeout (setq exit 'timeout))
;; `global-auto-revert-mode' could activate remote operations
;; while we aren't ready. We disable it temporarily.
(let ((garm (bound-and-true-p global-auto-revert-mode))
exit)
(when garm (global-auto-revert-mode -1))
(unwind-protect
(if timeout
(with-timeout (timeout (setq exit 'timeout))
(while (not exit)
(setq exit
(catch 'tramp-action
(tramp-process-one-action proc vec actions)))))
(while (not exit)
(setq exit
(catch 'tramp-action
(tramp-process-one-action proc vec actions)))))
(while (not exit)
(setq exit
(catch 'tramp-action
(tramp-process-one-action proc vec actions)))))
(when garm (global-auto-revert-mode)))
(with-current-buffer (tramp-get-connection-buffer vec)
(widen)
(tramp-message vec 6 "\n%s" (buffer-string)))