tg.sh: make sure GIT_OBJECT_DIRECTORY is never set to ""
commit866179eeb7d124b5452f30fe50ec4d16c6c67476
authorKyle J. McKay <mackyle@gmail.com>
Wed, 14 Jun 2017 19:12:46 +0000 (14 12:12 -0700)
committerKyle J. McKay <mackyle@gmail.com>
Wed, 14 Jun 2017 19:12:46 +0000 (14 12:12 -0700)
tree50dbccb37c90d8f8a4725afebb5ebfb8f5236922
parent526005a4b6538a68daf6dc8d5f2ff22ce23716fc
tg.sh: make sure GIT_OBJECT_DIRECTORY is never set to ""

Avoid exporting GIT_OBJECT_DIRECTORY unless it has a non-empty value.

GIT_OBJECT_DIRECTORY was always being marked for export, just in case
it had been fiddled with for alternate db purposes.

However, if it hasn't, and it's still unset (a very common occurrence),
a strictly pedantically interpreted reading of the POSIX standard
requires it to be placed in the environment EVEN IF IT'S UNSET!

This, of course, has the side-effect of setting it to the empty string!

Git checks the value using access and since `access("", X_OK)` always
fails (and Git is not smart enough to consider it unset if it's empty),
that pretty much guarantees immediate failure of all Git operations
that require a repository!

Fix this by removing the unintentional (aka BUG) exporting of an
unset or empty GIT_OBJECT_DIRECTORY and thereby eliminate a regression
introduced by the 0.19.7 release.

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