shlib.sh: be more tolerant of broken /bin/sh implementations
commit1cf28f09cbec9f9368f61f454ca5f86b2b482f75
authorKyle J. McKay <mackyle@gmail.com>
Sat, 15 Feb 2014 07:09:53 +0000 (14 23:09 -0800)
committerKyle J. McKay <mackyle@gmail.com>
Sat, 15 Feb 2014 07:09:53 +0000 (14 23:09 -0800)
tree9c26217f37cbdfca4bb154b7e6cbbac1c450e335
parent9536e540b6890b824f9dab10357cb75f446f3ab3
shlib.sh: be more tolerant of broken /bin/sh implementations

Some broken /bin/sh implementations fail to properly export variables
into the environment when a command like:

  ENV=val cmd

is run where cmd is a shell function.  The variables will have the
new value, but will not be exported which means that any external
commands run by the shell function will not see them.

Work around this problem by exporting the two Git variables we care
about if they are set and make the git function definition a subshell
instead of a group so the export is temporary.
shlib.sh