Skip to content

Commit 944d808

Browse files
steadmongitster
authored andcommitted
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 <[email protected]> Helped-by: Jonathan Tan <[email protected]> Signed-off-by: Josh Steadmon <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent e9d7761 commit 944d808

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

t/test-lib.sh

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -449,6 +449,8 @@ unset VISUAL EMAIL LANGUAGE $("$PERL_PATH" -e '
449449
unset XDG_CACHE_HOME
450450
unset XDG_CONFIG_HOME
451451
unset GITPERLLIB
452+
unset GIT_TRACE2_PARENT_NAME
453+
unset GIT_TRACE2_PARENT_SID
452454
TEST_AUTHOR_LOCALNAME=author
453455
TEST_AUTHOR_DOMAIN=example.com
454456
GIT_AUTHOR_EMAIL=${TEST_AUTHOR_LOCALNAME}@${TEST_AUTHOR_DOMAIN}

0 commit comments

Comments
 (0)