Prevent prompt from spewing errors if cwd has disappeared

This commit is contained in:
Jason Nader 2020-03-02 21:12:11 +09:00 committed by Fabian Homborg
parent 0fac2e0496
commit 86b7c1034c

View file

@ -7,7 +7,9 @@ function fish_print_hg_root
# Find an hg directory above $PWD
# without calling `hg root` because that's too slow
set -l root
set -l dir (pwd -P)
set -l dir (pwd -P 2>/dev/null)
or return 1
while test $dir != "/"
if test -f $dir'/.hg/dirstate'
echo $dir/.hg