diff options
author | Fabian Homborg <FHomborg@gmail.com> | 2015-09-06 14:58:09 +0200 |
---|---|---|
committer | Fabian Homborg <FHomborg@gmail.com> | 2015-09-06 14:58:09 +0200 |
commit | cb5511c8db9330c26b4bd6ac63893c875cca72c8 (patch) | |
tree | 2d1ddde252687e523f21a5f9e6c102eb655568f6 /share/functions/__fish_git_prompt.fish | |
parent | 54b6a1c08e2e3fefd0b052ccc4bf57a92588330a (diff) |
Vcs prompt: Break if vcs isn't installed
Prevents an annoying error message.
Fixes #2363.
Diffstat (limited to 'share/functions/__fish_git_prompt.fish')
-rw-r--r-- | share/functions/__fish_git_prompt.fish | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/share/functions/__fish_git_prompt.fish b/share/functions/__fish_git_prompt.fish index dc3f1112..4fb2f16c 100644 --- a/share/functions/__fish_git_prompt.fish +++ b/share/functions/__fish_git_prompt.fish @@ -346,6 +346,11 @@ function __fish_git_prompt_show_upstream --description "Helper function for __fi end function __fish_git_prompt --description "Prompt function for Git" + # If git isn't installed, there's nothing we can do + # Return 1 so the calling prompt can deal with it + if not command -s git >/dev/null + return 1 + end set -l repo_info (command git rev-parse --git-dir --is-inside-git-dir --is-bare-repository --is-inside-work-tree --short HEAD ^/dev/null) test -n "$repo_info"; or return |