diff --git a/share/functions/__fish_hg_prompt.fish b/share/functions/__fish_hg_prompt.fish index 769adfb65..2ec2591d5 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