mirror of
https://github.com/fish-shell/fish-shell.git
synced 2025-02-23 12:33:28 +08:00
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:
parent
0f0bb1e10f
commit
3e4bdf51d4
@ -30,7 +30,7 @@ function __fish_hg_prompt --description 'Write out the hg prompt'
|
|||||||
# 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
|
set -l dir (pwd -P)
|
||||||
while test $dir != "/"
|
while test $dir != "/"
|
||||||
if test -f $dir'/.hg/dirstate'
|
if test -f $dir'/.hg/dirstate'
|
||||||
set root $dir"/.hg"
|
set root $dir"/.hg"
|
||||||
|
Loading…
x
Reference in New Issue
Block a user