msysGit: Use a more generic way to change to the working tree root
commitfcf334a96d4f1017eee563b3955c407380bf2bb3
authorSebastian Schuberth <sschuberth@gmail.com>
Wed, 9 Nov 2011 11:01:52 +0000 (9 12:01 +0100)
committerSebastian Schuberth <sschuberth@gmail.com>
Wed, 9 Nov 2011 12:25:32 +0000 (9 13:25 +0100)
treeaa98de548987b8852ba8616977e90394dae345d9
parentf6f441475698e47edf547412ccab7e7ef713f70a
msysGit: Use a more generic way to change to the working tree root

When not using the msys.bat environment but another git installation to do
a rebase, the absolute "cd /" would not change to the working tree root
and cause git diff to fail with a usage information like

    usage: git diff [--no-index] <path> <path>

So use a more generic way to determine the working tree root within the
hook code that will work with another git installations, too. Note that
"git rev-parse --show-cdup" will return an empty string (not ".") if the
current directory is the working tree root, so we need to prefix the
resulting string with "./" in order for "cd" to work as expected.

Signed-off-by: Sebastian Schuberth <sschuberth@gmail.com>
share/msysGit/post-checkout-hook