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

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

[nongnu] elpa/git-commit cb7c45b3c6 2/3: magit--with-connection-local-va


From: ELPA Syncer
Subject: [nongnu] elpa/git-commit cb7c45b3c6 2/3: magit--with-connection-local-variables: Fix leaked 'vec' binding
Date: Sun, 23 Jan 2022 23:58:08 -0500 (EST)

branch: elpa/git-commit
commit cb7c45b3c67f613095ba20ac1190a882a5dd4f63
Author: Kyle Meyer <kyle@kyleam.com>
Commit: Kyle Meyer <kyle@kyleam.com>

    magit--with-connection-local-variables: Fix leaked 'vec' binding
    
    The recently added magit--with-connection-local-variables binds an
    unnecessary 'vec' variable around the expanded BODY.
---
 lisp/magit-utils.el | 19 +++++++++----------
 1 file changed, 9 insertions(+), 10 deletions(-)

diff --git a/lisp/magit-utils.el b/lisp/magit-utils.el
index 401d84bdfe..92d62e0aaa 100644
--- a/lisp/magit-utils.el
+++ b/lisp/magit-utils.el
@@ -1219,16 +1219,15 @@ Bind shell file name and switch for remote execution.
 This kludge provides the minimal functionality required by
 Magit."
     `(if (file-remote-p default-directory)
-         (let* ((vec (tramp-dissect-file-name default-directory))
-                (shell-file-name (tramp-get-method-parameter
-                                  vec
-                                  'tramp-remote-shell))
-                (shell-command-switch (mapconcat
-                                       #'identity
-                                       (tramp-get-method-parameter
-                                        vec
-                                        'tramp-remote-shell-args)
-                                       " ")))
+         (pcase-let ((`(,shell-file-name ,shell-command-switch)
+                      (let ((vec (tramp-dissect-file-name
+                                  default-directory)))
+                        (list (tramp-get-method-parameter
+                               vec 'tramp-remote-shell)
+                              (mapconcat #'identity
+                                         (tramp-get-method-parameter
+                                          vec 'tramp-remote-shell-args)
+                                         " ")))))
            ,@body)
        ,@body)))
 



reply via email to

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