summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-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