1. Brodie Rao
  2. git

Commits

Ævar Arnfjörð Bjarmason  committed 1f5ad6b

t: use sane_unset instead of unset

Change several tests to use the sane_unset function introduced in
v1.7.3.1-35-g00648ba instead of the built-in unset function.

This fixes a failure I was having on t9130-git-svn-authors-file.sh on
Solaris, and prevents several other issues from occurring.

Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

  • Participants
  • Parent commits d24fbca
  • Branches maint

Comments (0)

Files changed (6)

File t/t4150-am.sh

View file
 	git format-patch -M --stdout lorem^ >rename-add.patch &&
 
 	# reset time
-	unset test_tick &&
+	sane_unset test_tick &&
 	test_tick
 '
 

File t/t5560-http-backend-noserver.sh

View file
 GET() {
 	REQUEST_METHOD="GET" && export REQUEST_METHOD &&
 	run_backend "/repo.git/$1" &&
-	unset REQUEST_METHOD &&
+	sane_unset REQUEST_METHOD &&
 	if ! grep "Status" act.out >act
 	then
 		printf "Status: 200 OK\r\n" >act
 	REQUEST_METHOD="POST" && export REQUEST_METHOD &&
 	CONTENT_TYPE="application/x-$1-request" && export CONTENT_TYPE &&
 	run_backend "/repo.git/$1" "$2" &&
-	unset REQUEST_METHOD &&
-	unset CONTENT_TYPE &&
+	sane_unset REQUEST_METHOD &&
+	sane_unset CONTENT_TYPE &&
 	if ! grep "Status" act.out >act
 	then
 		printf "Status: 200 OK\r\n" >act

File t/t6032-merge-large-rename.sh

View file
 '
 
 test_expect_success 'massive simple rename does not spam added files' '
-	unset GIT_MERGE_VERBOSITY &&
+	sane_unset GIT_MERGE_VERBOSITY &&
 	git merge --no-stat simple-rename | grep -v Removing >output &&
 	test 5 -gt "$(wc -l < output)"
 '

File t/t9130-git-svn-authors-file.sh

View file
 		rm -r "$GIT_DIR" &&
 		test x = x"$(git config svn.authorsfile)" &&
 		test_config="$HOME"/.gitconfig &&
-		unset GIT_DIR &&
-		unset GIT_CONFIG &&
+		sane_unset GIT_DIR &&
+		sane_unset GIT_CONFIG &&
 		git config --global \
 		  svn.authorsfile "$HOME"/svn-authors &&
 		test x"$HOME"/svn-authors = x"$(git config svn.authorsfile)" &&

File t/t9200-git-cvsexportcommit.sh

View file
 
 	(mkdir shared &&
 	 cd shared &&
-	 unset GIT_DIR &&
+	 sane_unset GIT_DIR &&
 	 cvs co . &&
 	 git init &&
 	 git add " space" &&

File t/t9808-git-p4-chdir.sh

View file
 	test_when_finished cleanup_git &&
 	(
 		P4CONFIG=p4config && export P4CONFIG &&
-		unset P4PORT P4CLIENT &&
+		sane_unset P4PORT P4CLIENT &&
 		"$GITP4" clone --verbose --dest="$git" //depot
 	)
 '
 	test_when_finished cleanup_git &&
 	(
 		P4CONFIG=p4config && export P4CONFIG &&
-		unset P4PORT P4CLIENT &&
+		sane_unset P4PORT P4CLIENT &&
 		"$GITP4" clone --verbose --dest="git" //depot
 	)
 '