mirror of
https://github.com/fish-shell/fish-shell
synced 2025-01-14 14:03:58 +00:00
Prevent prompt from spewing errors if cwd has disappeared
This commit is contained in:
parent
0fac2e0496
commit
86b7c1034c
1 changed files with 3 additions and 1 deletions
|
@ -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
|
||||
|
|
Loading…
Reference in a new issue