mirror of
https://github.com/fish-shell/fish-shell
synced 2025-01-19 16:34:24 +00:00
Prevent prompt from spewing errors if cwd has disappeared
This commit is contained in:
parent
e0645c9473
commit
33f55e05d0
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