diff --git a/lisp/net/tramp-sh.el b/lisp/net/tramp-sh.el index 48ba3d09e3e..502040902e1 100644 --- a/lisp/net/tramp-sh.el +++ b/lisp/net/tramp-sh.el @@ -2338,6 +2338,11 @@ the uid and gid from FILENAME." ;; Save exit. (ignore-errors (delete-file tmpfile))))))))) + ;; When newname did exist, we have wrong cached values. + (when t2 + (with-parsed-tramp-file-name newname v2 + (tramp-flush-file-properties v2 v2-localname))) + ;; Set the time and mode. Mask possible errors. (ignore-errors (when keep-date