X-Git-Url: https://git.tokkee.org/?a=blobdiff_plain;f=git-sh-setup.sh;h=d56426dd396190a07de7d661cd22fb284b759ca8;hb=453541fcfcbc54aa3b0035667e5d5885d407d0a5;hp=dfcb8078f508d6cc26d312d61b64e0185e90b74b;hpb=66276d972c0682d49773c20ca67c33bdab9ab76d;p=git.git diff --git a/git-sh-setup.sh b/git-sh-setup.sh index dfcb8078f..d56426dd3 100755 --- a/git-sh-setup.sh +++ b/git-sh-setup.sh @@ -120,20 +120,11 @@ is_bare_repository () { } cd_to_toplevel () { - cdup=$(git rev-parse --show-cdup) - if test ! -z "$cdup" - then - # The "-P" option says to follow "physical" directory - # structure instead of following symbolic links. When cdup is - # "../", this means following the ".." entry in the current - # directory instead textually removing a symlink path element - # from the PWD shell variable. The "-P" behavior is more - # consistent with the C-style chdir used by most of Git. - cd -P "$cdup" || { - echo >&2 "Cannot chdir to $cdup, the toplevel of the working tree" - exit 1 - } - fi + cdup=$(git rev-parse --show-toplevel) && + cd "$cdup" || { + echo >&2 "Cannot chdir to $cdup, the toplevel of the working tree" + exit 1 + } } require_work_tree () {