mirror of
https://github.com/fish-shell/fish-shell.git
synced 2024-11-26 02:13:38 +08:00
__fish_hg_prompt: Bail early if not in a hg repo
This commit is contained in:
parent
4f3ff3d77f
commit
eadd4d9b71
|
@ -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
|
||||||
|
|
Loading…
Reference in New Issue
Block a user