__fish_hg_prompt: Bail early if not in a hg repo

This commit is contained in:
Fabian Homborg 2015-09-26 20:40:48 +02:00
parent 4f3ff3d77f
commit eadd4d9b71

View File

@ -26,6 +26,12 @@ function __fish_hg_prompt --description 'Write out the hg prompt'
if not command -s hg >/dev/null if not command -s hg >/dev/null
return 1 return 1
end 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) set -l branch (hg branch ^/dev/null)
if test -z $branch if test -z $branch
return return