git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: [PATCH 2/3] t0001,t1510,t3301: use sane_unset which always returns with status 0

From
Junio C Hamano <gitster@pobox.com>
Date
Jan 6, 2011, 20:32 UTC
Message-ID
<7vlj2xai2v.fsf@alter.siamese.dyndns.org>
In-Reply-To
<gmeXEearzUOUEst4-B2b8nKnIcuDy8iOxR9s9wmOFYzBZT5rwFSFsnedLx8orqTDP1ztkJap7K8@cipher.nrlssc.navy.mil>
Thanks; there are a bit more from 
 $git grep -n -e '^[ 	]*unset[ 	].*&&' t
* t/t4150-am.sh:132:	unset test_tick &&
This should be safe, as we have already run test_tick to set it earlier.
* t/t5560-http-backend-noserver.sh:20:	unset REQUEST_METHOD &&
* t/t5560-http-backend-noserver.sh:33:	unset REQUEST_METHOD &&
* t/t5560-http-backend-noserver.sh:34:	unset CONTENT_TYPE &&
The varilable was earlier set inside the same function; safe.
* t/t5601-clone.sh:167:		unset GIT_CONFIG_NOGLOBAL &&
test-lib.sh sets this for us and this unsets it inside a subshell; safe.
* t/t6032-merge-large-rename.sh:98:	unset GIT_MERGE_VERBOSITY &&
test-lib.sh sets this for us and this unsets it; safe.

However, this unsets the variable permanently, damaging the environment for tests other people later may add at the end of the script, which is bad. But that is outside the scope of your fix.

* t/t9130-git-svn-authors-file.sh:99:		unset GIT_CONFIG_NOGLOBAL &&
* t/t9130-git-svn-authors-file.sh:100:		unset GIT_DIR &&

test-lib.sh and then lib-git-svn.sh set these for us and this unsets them inside a subshell; safe.

* t/t9130-git-svn-authors-file.sh:101:		unset GIT_CONFIG &&

As far as I can tell, this is unsafe; nobody has set GIT_CONFIG up to this point.

* t/t9200-git-cvsexportcommit.sh:324:	 unset GIT_DIR &&
test-lib.sh sets this for us and this unsets it inside a subshell; safe.
Previous: Brandon CaseyNext: Brandon Casey
Message 3 of 5 in “trace.c: ensure NULL is not passed to printf”
  1. 1/3 trace.c: ensure NULL is not passed to printfBrandon Casey, Jan 6, 2011
  2. 2/3 t0001,t1510,t3301: use sane_unset which always returns with status 0Brandon Casey, Jan 6, 2011
  3. Junio C HamanoJan 6, 2011
  4. Brandon CaseyJan 6, 2011
  5. 3/3 t3032: limit sed branch labels to 8 charactersBrandon Casey, Jan 6, 2011

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.