branch: master
commit d4f37355746d7c31016917a18a21268956c5d995
Author: Oleh Krehel <[email protected]>
Commit: Oleh Krehel <[email protected]>

    counsel.el (ivy-ffap-url-functions): Check if git is present
    
    Fixes #1216
---
 counsel.el | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/counsel.el b/counsel.el
index 63e42ef..8fefad9 100644
--- a/counsel.el
+++ b/counsel.el
@@ -1535,8 +1535,9 @@ Does not list the currently checked out one."
     (define-key map (kbd "C-<backspace>") 'counsel-up-directory)
     map))
 
-(add-to-list 'ivy-ffap-url-functions 'counsel-github-url-p)
-(add-to-list 'ivy-ffap-url-functions 'counsel-emacs-url-p)
+(when (executable-find "git")
+  (add-to-list 'ivy-ffap-url-functions 'counsel-github-url-p)
+  (add-to-list 'ivy-ffap-url-functions 'counsel-emacs-url-p))
 (add-to-list 'ivy-ffap-url-functions 'counsel-url-expand)
 (defun counsel-find-file-cd-bookmark-action (_)
   "Reset `counsel-find-file' from selected directory."

Reply via email to