[Top][All Lists]

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

[elpa] master b4492a3 002/399: counsel.el (counsel-git-checkout-action):

From: Oleh Krehel
Subject: [elpa] master b4492a3 002/399: counsel.el (counsel-git-checkout-action): Quote branch names
Date: Sat, 20 Jul 2019 14:56:36 -0400 (EDT)

branch: master
commit b4492a301ac00b5aefbcdf89ae36924055e4256d
Author: Hans Jerry Illikainen <address@hidden>
Commit: Hans Jerry Illikainen <address@hidden>

    counsel.el (counsel-git-checkout-action): Quote branch names
    Quoting branch names is necessary to avoid executing shell
    Fixes #1905.
 counsel.el | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/counsel.el b/counsel.el
index ee78d9f..af83039 100644
--- a/counsel.el
+++ b/counsel.el
@@ -1694,7 +1694,9 @@ The command is passed a single argument comprising all 
 in BRANCH up to, but not including, the first space
 character (#x20), or the string's end if it lacks a space."
-   (format "git checkout %s" (substring branch 0 (string-match-p " " 
+   (format "git checkout %s"
+           (shell-quote-argument
+            (substring branch 0 (string-match-p " " branch))))))
 (defun counsel-git-branch-list ()
   "Return list of branches in the current git repository.

reply via email to

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