emacs-elpa-diffs
[Top][All Lists]
Advanced

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

[nongnu] elpa/git-commit a3d3758b26 2/3: magit-file-rename: Fix initial-


From: ELPA Syncer
Subject: [nongnu] elpa/git-commit a3d3758b26 2/3: magit-file-rename: Fix initial-input for destination
Date: Tue, 1 Nov 2022 18:58:46 -0400 (EDT)

branch: elpa/git-commit
commit a3d3758b268e40ecb6ee399833a8388dc59a94dd
Author: Jonas Bernoulli <jonas@bernoul.li>
Commit: Jonas Bernoulli <jonas@bernoul.li>

    magit-file-rename: Fix initial-input for destination
    
    Closes #4807.
---
 lisp/magit-files.el | 9 ++++-----
 1 file changed, 4 insertions(+), 5 deletions(-)

diff --git a/lisp/magit-files.el b/lisp/magit-files.el
index c1a150fd2b..085ec0ff58 100644
--- a/lisp/magit-files.el
+++ b/lisp/magit-files.el
@@ -404,11 +404,10 @@ NEWNAME may be a file or directory name.  If FILE isn't 
tracked in
 Git, fallback to using `rename-file'."
   (interactive
    (let* ((file (magit-read-file "Rename file"))
-          (dir (file-name-directory file))
-          (newname (read-file-name (format "Move %s to destination: " file)
-                                   (and dir (expand-file-name dir)))))
-     (list (expand-file-name file (magit-toplevel))
-           (expand-file-name newname))))
+          (path (expand-file-name file (magit-toplevel))))
+     (list path (expand-file-name
+                 (read-file-name (format "Move %s to destination: " file)
+                                 (file-name-directory path))))))
   (let ((oldbuf (get-file-buffer file))
         (dstdir (file-name-directory newname))
         (dstfile (if (directory-name-p newname)



reply via email to

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