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

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

[nongnu] elpa/git-commit 781aa35c7c 2/4: magit--shell-command: Use magit


From: ELPA Syncer
Subject: [nongnu] elpa/git-commit 781aa35c7c 2/4: magit--shell-command: Use magit--with-connection-local-variables
Date: Wed, 5 Jan 2022 23:58:09 -0500 (EST)

branch: elpa/git-commit
commit 781aa35c7cf3933fc7d8d8d91f5967e8d2df1756
Author: Andrey Smirnov <andrew.smirnov@gmail.com>
Commit: Kyle Meyer <kyle@kyleam.com>

    magit--shell-command: Use magit--with-connection-local-variables
    
    Use magit--with-connection-local-variables macro to make sure that
    `shell-file-name` and `shell-command-switch` have values appropriate
    for the machine we are trying to run the command on.
    
    Consider the scenario where we are using Emacs + Magit running on a
    Windows machine while manipulating a remote repo on a Linux machine
    with Tramp + plink. Without `magit--with-connection-local-variables`
    we'll have `shell-file-name` pointing to `cmdproxy.exe` which, for
    obvious reasons, won't work on the remote Linux box.
---
 lisp/magit.el | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/lisp/magit.el b/lisp/magit.el
index f79828d613..767f57d7d2 100644
--- a/lisp/magit.el
+++ b/lisp/magit.el
@@ -447,8 +447,9 @@ is run in the top-level directory of the current working 
tree."
   (let ((default-directory (or directory default-directory))
         (process-environment process-environment))
     (push "GIT_PAGER=cat" process-environment)
-    (magit-start-process shell-file-name nil
-                         shell-command-switch command))
+    (magit--with-connection-local-variables
+     (magit-start-process shell-file-name nil
+                          shell-command-switch command)))
   (magit-process-buffer))
 
 (defun magit-read-shell-command (&optional toplevel initial-input)



reply via email to

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