Teach hg prompt to use pwd -P

The hg prompt walks up the directory hierarchy to decide if we are in a
repo subdirectory. Because hg is an external command, it resolves symlinks.
Switch to using pwd -P so hg and fish will have the same view of the hg repo.

Based on comment:
https://github.com/fish-shell/fish-shell/pull/5190#issuecomment-421912360
This commit is contained in:
ridiculousfish 2018-10-06 16:53:02 -07:00
parent 0f0bb1e10f
commit 3e4bdf51d4

View file

@ -30,7 +30,7 @@ function __fish_hg_prompt --description 'Write out the hg prompt'
# Find an hg directory above $PWD
# without calling `hg root` because that's too slow
set -l root
set -l dir $PWD
set -l dir (pwd -P)
while test $dir != "/"
if test -f $dir'/.hg/dirstate'
set root $dir"/.hg"