diff --git a/lisp/tramp.el b/lisp/tramp.el index 933bac7e..59306635 100644 --- a/lisp/tramp.el +++ b/lisp/tramp.el @@ -4029,6 +4029,17 @@ Let-bind it when necessary.") (cond ((not (file-exists-p file1)) nil) ((not (file-exists-p file2)) t) + ;; Tramp reads and writes timestamps on secon level. So we round + ;; the timestamps to seconds w/o fractions. + ;; `time-convert' has been introduced with Emacs 27.1. + ((fboundp 'time-convert) + (time-less-p + (tramp-compat-funcall + 'time-convert + (file-attribute-modification-time (file-attributes file2)) 'integer) + (tramp-compat-funcall + 'time-convert + (file-attribute-modification-time (file-attributes file1)) 'integer))) (t (time-less-p (file-attribute-modification-time (file-attributes file2)) (file-attribute-modification-time (file-attributes file1))))))