author | Marcel M. Cary <marcel@oak.homeunix.org> | |
Sat, 7 Feb 2009 03:24:28 +0000 (19:24 -0800) | ||
committer | Junio C Hamano <gitster@pobox.com> | |
Sat, 7 Feb 2009 08:45:29 +0000 (00:45 -0800) | ||
commit | 2c3c395e84409c278bd7b050877c36d04b952056 | |
tree | 65662f26b92ed2d8c973964b6985d29b6db44149 | tree | snapshot |
parent | ba743d1b0ce0b44c797c0de06c9db2781e4d1fdd | commit | diff |
git-sh-setup: Use "cd" option, not /bin/pwd, for symlinked work tree
In cd_to_toplevel, instead of 'cd $(unset PWD; /bin/pwd)/$path'
use 'cd -P $path'. The "-P" option yields a desirable similarity to
C chdir.
While the "-P" option may be slightly less commonly supported than
/bin/pwd, it is more concise, better tested, and less error prone.
I've already added the 'unset PWD' to fix the /bin/pwd solution on
BSD; there may be more edge cases out there.
This still passes all the same test cases in t5521-pull-symlink.sh and
t2300-cd-to-toplevel.sh, even before updating them to use 'pwd -P'.
Signed-off-by: Junio C Hamano <gitster@pobox.com>
In cd_to_toplevel, instead of 'cd $(unset PWD; /bin/pwd)/$path'
use 'cd -P $path'. The "-P" option yields a desirable similarity to
C chdir.
While the "-P" option may be slightly less commonly supported than
/bin/pwd, it is more concise, better tested, and less error prone.
I've already added the 'unset PWD' to fix the /bin/pwd solution on
BSD; there may be more edge cases out there.
This still passes all the same test cases in t5521-pull-symlink.sh and
t2300-cd-to-toplevel.sh, even before updating them to use 'pwd -P'.
Signed-off-by: Junio C Hamano <gitster@pobox.com>
git-sh-setup.sh | diff | blob | history | |
t/t2300-cd-to-toplevel.sh | diff | blob | history |