diff options
author | 2015-09-26 20:40:48 +0200 | |
---|---|---|
committer | 2015-09-26 20:40:48 +0200 | |
commit | eadd4d9b7118e31b82fec5a13008d88b0af46357 (patch) | |
tree | 5c0f0d6ab76a3dd98d9e124921df031689bf53d6 /share | |
parent | 4f3ff3d77f5f46adc7621316138aa0173db25c22 (diff) |
__fish_hg_prompt: Bail early if not in a hg repo
Diffstat (limited to 'share')
-rw-r--r-- | share/functions/__fish_hg_prompt.fish | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/share/functions/__fish_hg_prompt.fish b/share/functions/__fish_hg_prompt.fish index 769adfb6..2ec2591d 100644 --- a/share/functions/__fish_hg_prompt.fish +++ b/share/functions/__fish_hg_prompt.fish @@ -26,6 +26,12 @@ function __fish_hg_prompt --description 'Write out the hg prompt' if not command -s hg >/dev/null return 1 end + + # If we're not in an hg repository, bail + if not hg root >/dev/null ^/dev/null + return 0 + end + set -l branch (hg branch ^/dev/null) if test -z $branch return |