aboutsummaryrefslogtreecommitdiffstats
path: root/t/test-lib.sh
diff options
context:
space:
mode:
authorJosh Steadmon <steadmon@google.com>2022-01-13 19:33:36 -0800
committerJunio C Hamano <gitster@pobox.com>2022-01-20 10:51:33 -0800
commit944d808e42817d48bea480c135bc9d3efd53d4e7 (patch)
tree3159a1bb538fa0f8d0bd46814364e87ecda60011 /t/test-lib.sh
parente9d7761bb94f20acc98824275e317fa82436c25d (diff)
downloadgit-944d808e42817d48bea480c135bc9d3efd53d4e7.tar.gz
test-lib: unset trace2 parent envvars
The trace2 subsystem can inherit certain information from parent processes via environment variables; e.g., the parent command name and session ID. This allows trace2 to note when a command is the child process of another Git process, and to adjust various pieces of output accordingly. This behavior breaks certain tests that examine trace2 output when the tests run as a child of another git process, such as in `git rebase -x "make test"`. While we could fix this by unsetting the relevant variables in the affected tests (currently t0210, t0211, t0212, and t6421), this would leave other tests vulnerable to similar breakage if new test cases are added which inspect trace2 output. So fix this in general by unsetting GIT_TRACE2_PARENT_NAME and GIT_TRACE2_PARENT_SID in test-lib.sh. Reported-by: Emily Shaffer <emilyshaffer@google.com> Helped-by: Jonathan Tan <jonathantanmy@google.com> Signed-off-by: Josh Steadmon <steadmon@google.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 't/test-lib.sh')
-rw-r--r--t/test-lib.sh2
1 files changed, 2 insertions, 0 deletions
diff --git a/t/test-lib.sh b/t/test-lib.sh
index 2679a7596a..70668f5d31 100644
--- a/t/test-lib.sh
+++ b/t/test-lib.sh
@@ -449,6 +449,8 @@ unset VISUAL EMAIL LANGUAGE $("$PERL_PATH" -e '
unset XDG_CACHE_HOME
unset XDG_CONFIG_HOME
unset GITPERLLIB
+unset GIT_TRACE2_PARENT_NAME
+unset GIT_TRACE2_PARENT_SID
TEST_AUTHOR_LOCALNAME=author
TEST_AUTHOR_DOMAIN=example.com
GIT_AUTHOR_EMAIL=${TEST_AUTHOR_LOCALNAME}@${TEST_AUTHOR_DOMAIN}