mirror of
https://github.com/fish-shell/fish-shell.git
synced 2025-03-27 14:45:13 +08:00
Prevent prompt from spewing errors if cwd has disappeared
This commit is contained in:
parent
e0645c9473
commit
33f55e05d0
@ -7,7 +7,9 @@ function fish_print_hg_root
|
|||||||
# Find an hg directory above $PWD
|
# Find an hg directory above $PWD
|
||||||
# without calling `hg root` because that's too slow
|
# without calling `hg root` because that's too slow
|
||||||
set -l root
|
set -l root
|
||||||
set -l dir (pwd -P)
|
set -l dir (pwd -P 2>/dev/null)
|
||||||
|
or return 1
|
||||||
|
|
||||||
while test $dir != "/"
|
while test $dir != "/"
|
||||||
if test -f $dir'/.hg/dirstate'
|
if test -f $dir'/.hg/dirstate'
|
||||||
echo $dir/.hg
|
echo $dir/.hg
|
||||||
|
Loading…
x
Reference in New Issue
Block a user