tg.sh: work around broken git rev-parse --git-common-dir
commit042ee032bb1e5fca9a629a2b2b04510de28fd408
authorKyle J. McKay <mackyle@gmail.com>
Wed, 15 Feb 2017 13:53:25 +0000 (15 05:53 -0800)
committerKyle J. McKay <mackyle@gmail.com>
Wed, 15 Feb 2017 13:53:25 +0000 (15 05:53 -0800)
treeafb631db182a2f053d4f86e8dc4ee487b4059a96
parent86871ef2fc32647099147f9c767d365019d35644
tg.sh: work around broken git rev-parse --git-common-dir

If the current working directory is not set to the top level
directory of a normal, non-bare git checkout then the result of
the `git rev-parse --git-common-dir` command may well be a
nonsensical, nonexistent directory string.

Compensate for this by first doing a cd to the top-level of
the current working tree (if there is one) before using the
rev-parse --git-common-dir operation and then using pwd to
get an absolute path.

And since the $git_common_dir variable is now always an
absolute path, make sure the $git_dir variable is too.

Signed-off-by: Kyle J. McKay <mackyle@gmail.com>
tg.sh