summaryrefslogtreecommitdiff
path: root/etckeeper
diff options
context:
space:
mode:
authorJoey Hess <joey@kitenet.net>2013-11-10 11:54:09 -0400
committerJoey Hess <joey@kitenet.net>2013-11-10 11:54:09 -0400
commitb6e9e1f4bd3161d6d4879784c2de2c103aa8f3ae (patch)
treedff0a2c585f0002842f39e172833dcd6916421a1 /etckeeper
parentb43e341f4dd64ee319f24d4bfb1c76b85b1c2fcf (diff)
guard unsets
Apparently fails with netbsd's shell. Unsure if that shell is POSIX.
Diffstat (limited to 'etckeeper')
-rwxr-xr-xetckeeper8
1 files changed, 6 insertions, 2 deletions
diff --git a/etckeeper b/etckeeper
index cb180b6..1498b96 100755
--- a/etckeeper
+++ b/etckeeper
@@ -16,8 +16,12 @@ if [ -e $conf ]; then
. $conf
fi
-unset GIT_WORK_TREE
-unset GIT_DIR
+if [ -n "$GIT_WORK_TREE" ]; then
+ unset GIT_WORK_TREE
+fi
+if [ -n "$GIT_DIR" ]; then
+ unset GIT_DIR
+fi
program_directory="${0%/*}"
if [ -n "$program_directory" ]; then