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

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

[elpa] externals/ivy-hydra e22c8df 103/395: counsel.el (counsel-git-cand


From: Basil L. Contovounesios
Subject: [elpa] externals/ivy-hydra e22c8df 103/395: counsel.el (counsel-git-cands): Avoid an extra call to counsel-git-root
Date: Thu, 25 Feb 2021 08:31:41 -0500 (EST)

branch: externals/ivy-hydra
commit e22c8dfd28ab1874b71b68628666c22e1112495f
Author: Oleh Krehel <ohwoeowho@gmail.com>
Commit: Oleh Krehel <ohwoeowho@gmail.com>

    counsel.el (counsel-git-cands): Avoid an extra call to counsel-git-root
---
 counsel.el | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/counsel.el b/counsel.el
index 76be2f8..0d8c212 100644
--- a/counsel.el
+++ b/counsel.el
@@ -1253,8 +1253,8 @@ Like `locate-dominating-file', but DIR defaults to
   (or (counsel--git-root)
       (error "Not in a Git repository")))
 
-(defun counsel-git-cands ()
-  (let ((default-directory (counsel-locate-git-root)))
+(defun counsel-git-cands (dir)
+  (let ((default-directory dir))
     (split-string
      (shell-command-to-string counsel-git-cmd)
      "\0"
@@ -1267,7 +1267,7 @@ INITIAL-INPUT can be given as the initial minibuffer 
input."
   (interactive)
   (counsel-require-program counsel-git-cmd)
   (let ((default-directory (counsel-locate-git-root)))
-    (ivy-read "Find file: " (counsel-git-cands)
+    (ivy-read "Find file: " (counsel-git-cands default-directory)
               :initial-input initial-input
               :action #'counsel-git-action
               :caller 'counsel-git)))



reply via email to

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