mirror of
https://github.com/fish-shell/fish-shell.git
synced 2024-11-22 15:37:59 +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
|
||||
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
|
||||
|
|
Loading…
Reference in New Issue
Block a user