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

Re: [PATCH 3/3] config tests: fix harmless but broken "rm -r" cleanup

From
Junio C Hamano <gitster@pobox.com>
Date
Jun 22, 2022, 05:37 UTC
Message-ID
<xmqq8rpp8div.fsf@gitster.g>
In-Reply-To
<xmqq4k0dfxxm.fsf@gitster.g>
Junio C Hamano <gitster@pobox.com> writes:
Show 14 quoted lines
> Ævar Arnfjörð Bjarmason  <avarab@gmail.com> writes:
>
>>  test_expect_success 'override global and system config' '
>> -	test_when_finished rm -f "$HOME"/.config/git &&
>> +	test_when_finished "rm -rf \"$HOME\"/.config/git" &&
>
> As this string is evaled, isn't it safer to defer dereferencing the
> environment variable at the runtime by quoting the dollar-sign, too?
>
> I.e.
>
> 	test_when_finished rm -rf \"\$HOME\"/.config/git &&
>
> or something?
It probably would matter if $HOME had a double-quote in it, I think
Previous: Junio C HamanoNext: Ævar Arnfjörð Bjarmason
Message 7 of 12 in “tests: fix tests broken if a " " is in the checkout dir's path”
  1. 0/3 tests: fix tests broken if a " " is in the checkout dir's pathÆvar Arnfjörð Bjarmason, Jun 21, 2022
  2. 1/3 tests: add missing double quotes to included library pathsÆvar Arnfjörð Bjarmason, Jun 21, 2022
  3. Junio C HamanoJun 21, 2022
  4. 2/3 test-lib.sh: fix prepend_var() quoting issueÆvar Arnfjörð Bjarmason, Jun 21, 2022
  5. 3/3 config tests: fix harmless but broken "rm -r" cleanupÆvar Arnfjörð Bjarmason, Jun 21, 2022
  6. Junio C HamanoJun 21, 2022
  7. Junio C HamanoJun 22, 2022
  8. 0/3 tests: fix tests broken if a " " is in the checkout dir's pathÆvar Arnfjörð Bjarmason, Jun 30, 2022
  9. 1/3 tests: add missing double quotes to included library pathsÆvar Arnfjörð Bjarmason, Jun 30, 2022
  10. 2/3 test-lib.sh: fix prepend_var() quoting issueÆvar Arnfjörð Bjarmason, Jun 30, 2022
  11. 3/3 config tests: fix harmless but broken "rm -r" cleanupÆvar Arnfjörð Bjarmason, Jun 30, 2022
  12. Junio C HamanoJun 30, 2022

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.