Skip to content

Commit 90cff96

Browse files
raalkmlgitster
authored andcommitted
HOME must be set before calling git-init when creating test repositories
Otherwise the created test repositories will be affected by users ~/.gitconfig. For example, setting core.logAllrefupdates in users config will make all calls to "git config --unset core.logAllrefupdates" fail which will break the first test which uses the statement and expects it to succeed. Signed-off-by: Alex Riesen <[email protected]> Acked-by: Jeff King <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent f1723ee commit 90cff96

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

t/test-lib.sh

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1004,14 +1004,14 @@ rm -fr "$test" || {
10041004
exit 1
10051005
}
10061006

1007+
HOME="$TRASH_DIRECTORY"
1008+
export HOME
1009+
10071010
test_create_repo "$test"
10081011
# Use -P to resolve symlinks in our working directory so that the cwd
10091012
# in subprocesses like git equals our $PWD (for pathname comparisons).
10101013
cd -P "$test" || exit 1
10111014

1012-
HOME=$(pwd)
1013-
export HOME
1014-
10151015
this_test=${0##*/}
10161016
this_test=${this_test%%-*}
10171017
for skp in $GIT_SKIP_TESTS

0 commit comments

Comments
 (0)