diff --git a/lisp/tramp-sh.el b/lisp/tramp-sh.el index 1301cd63..50a33cc3 100644 --- a/lisp/tramp-sh.el +++ b/lisp/tramp-sh.el @@ -2521,6 +2521,10 @@ The method used must be an out-of-band method." ;; cached password). (tramp-cleanup-connection v 'keep-debug 'keep-password)))) + ;; The cached file properties might be wrong if NEWNAME didn't + ;; exist. Flush them. + (tramp-flush-file-properties v (tramp-file-local-name newname)) + ;; Handle KEEP-DATE argument. (when (and keep-date (not copy-keep-date)) (tramp-compat-set-file-times