@matheusbsbs / matheus-bagliano / commits / 160ad147fe
Fork 0

wrap-for-bin: do not export an empty GIT_TEMPLATE_DIR

With bash on some platforms (e.g. FreeBSD 8.0), exporting an unset variable does not "unexport" it. The called process gets an empty string from getenv(3) instead of NULL. Signed-off-by: Junio C Hamano <gitster@pobox.com>

Junio C Hamano committed Mar 2, 2010 at 16:27 UTC 160ad147fe9f644fc35224095e1d1a01be0208de
1 file changed +7 -2
wrap-for-bin.sh
+7 -2
@@ -7,10 +7,15 @@
7 # @@BUILD_DIR@@ and @@PROG@@.
8
9 GIT_EXEC_PATH='@@BUILD_DIR@@'
10 -test -z "$NO_SET_GIT_TEMPLATE_DIR" &&
10 +if test -n "$NO_SET_GIT_TEMPLATE_DIR"
11 +then
12 + unset GIT_TEMPLATE_DIR
13 +else
14 GIT_TEMPLATE_DIR='@@BUILD_DIR@@/templates/blt'
15 + export GIT_TEMPLATE_DIR
16 +fi
17 GITPERLLIB='@@BUILD_DIR@@/perl/blib/lib'
18 PATH='@@BUILD_DIR@@/bin-wrappers:'"$PATH"
14 -export GIT_EXEC_PATH GIT_TEMPLATE_DIR GITPERLLIB PATH
19 +export GIT_EXEC_PATH GITPERLLIB PATH
20
21 exec "${GIT_EXEC_PATH}/@@PROG@@" "$@"