summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLibravatar Junio C Hamano <gitster@pobox.com>2021-09-10 11:46:23 -0700
committerLibravatar Junio C Hamano <gitster@pobox.com>2021-09-10 11:46:24 -0700
commite4897d2bde2bc6f8a63c468e1ff8617314269dcd (patch)
tree79068c9884a37fb164563684491ce7cc6399b590
parentMerge branch 'jh/sparse-index-resize-fix' (diff)
parenttest-lib: set GIT_CEILING_DIRECTORIES to protect the surrounding repository (diff)
downloadtgif-e4897d2bde2bc6f8a63c468e1ff8617314269dcd.tar.xz
Merge branch 'sg/set-ceiling-during-tests'
Buggy tests could damage repositories outside the throw-away test area we created. We now by default export GIT_CEILING_DIRECTORIES to limit the damage from such a stray test. * sg/set-ceiling-during-tests: test-lib: set GIT_CEILING_DIRECTORIES to protect the surrounding repository
-rw-r--r--t/test-lib.sh3
1 files changed, 2 insertions, 1 deletions
diff --git a/t/test-lib.sh b/t/test-lib.sh
index abcfbed6d6..fc1e521519 100644
--- a/t/test-lib.sh
+++ b/t/test-lib.sh
@@ -1343,7 +1343,8 @@ fi
GIT_TEMPLATE_DIR="$GIT_BUILD_DIR"/templates/blt
GIT_CONFIG_NOSYSTEM=1
GIT_ATTR_NOSYSTEM=1
-export PATH GIT_EXEC_PATH GIT_TEMPLATE_DIR GIT_CONFIG_NOSYSTEM GIT_ATTR_NOSYSTEM
+GIT_CEILING_DIRECTORIES="$TRASH_DIRECTORY/.."
+export PATH GIT_EXEC_PATH GIT_TEMPLATE_DIR GIT_CONFIG_NOSYSTEM GIT_ATTR_NOSYSTEM GIT_CEILING_DIRECTORIES
if test -z "$GIT_TEST_CMP"
then