emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Emacs-diffs] emacs-26 1d77078: Fix Bug#31941


From: Michael Albinus
Subject: [Emacs-diffs] emacs-26 1d77078: Fix Bug#31941
Date: Sun, 24 Jun 2018 04:24:48 -0400 (EDT)

branch: emacs-26
commit 1d7707886d9b2903666fdcfd7c7962b5e17e6b36
Author: Michael Albinus <address@hidden>
Commit: Michael Albinus <address@hidden>

    Fix Bug#31941
    
    * lisp/net/tramp-sh.el (tramp-do-copy-or-rename-file): In case of
    FILENAME being a directory, check whether `copy-directory' could
    be avoided.  Suggested by Stephen Nutt <address@hidden>.  (Bug#31941)
    (tramp-do-copy-or-rename-file-directly): Call "cp" with "-r".
---
 lisp/net/tramp-sh.el | 8 +++++---
 1 file changed, 5 insertions(+), 3 deletions(-)

diff --git a/lisp/net/tramp-sh.el b/lisp/net/tramp-sh.el
index 02fb864..3e99ab5 100644
--- a/lisp/net/tramp-sh.el
+++ b/lisp/net/tramp-sh.el
@@ -2038,7 +2038,9 @@ file names."
   (unless (memq op '(copy rename))
     (error "Unknown operation `%s', must be `copy' or `rename'" op))
 
-  (if (file-directory-p filename)
+  (if (and
+       (file-directory-p filename)
+       (not (tramp-equal-remote filename newname)))
       (progn
        (copy-directory filename newname keep-date t)
        (when (eq op 'rename) (delete-directory filename 'recursive)))
@@ -2187,8 +2189,8 @@ the uid and gid from FILENAME."
                     (file-attributes filename)))
        (file-modes (tramp-default-file-modes filename)))
     (with-parsed-tramp-file-name (if t1 filename newname) nil
-      (let* ((cmd (cond ((and (eq op 'copy) preserve-uid-gid) "cp -f -p")
-                       ((eq op 'copy) "cp -f")
+      (let* ((cmd (cond ((and (eq op 'copy) preserve-uid-gid) "cp -f -r -p")
+                       ((eq op 'copy) "cp -f -r")
                        ((eq op 'rename) "mv -f")
                        (t (tramp-error
                            v 'file-error



reply via email to

[Prev in Thread] Current Thread [Next in Thread]