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

[PATCH v2 0/3] tests: fix tests broken if a " " is in the checkout dir's path

From
Ævar Arnfjörð Bjarmason <avarab@gmail.com>
Date
Jun 30, 2022, 10:18 UTC
Message-ID
<cover-v2-0.3-00000000000-20220630T101646Z-avarab@gmail.com>
In-Reply-To
<cover-0.3-00000000000-20220621T221928Z-avarab@gmail.com>

A re-roll of https://lore.kernel.org/git/cover-0.3-00000000000-20220621T221928Z-avarab@gmail.com/; Changes since v1:

 - Clarified IFS splitting issues in 1/3, as requested by Junio
 - Fixed $HOME quoting issue in 3/3, and also added the missing cleanup
   for $HOME/.gitconfig to that test.
Ævar Arnfjörð Bjarmason (3):
  tests: add missing double quotes to included library paths
  test-lib.sh: fix prepend_var() quoting issue
  config tests: fix harmless but broken "rm -r" cleanup
 t/t1300-config.sh         | 5 +++--
 t/t3700-add.sh            | 2 +-
 t/t3903-stash.sh          | 2 +-
 t/t7609-mergetool--lib.sh | 2 +-
 t/test-lib.sh             | 4 ++--
 5 files changed, 8 insertions(+), 7 deletions(-)
Range-diff against v1:
1:  05ba5e7f837 ! 1:  f4ef137d076 tests: add missing double quotes to included library paths
    @@ Metadata
      ## Commit message ##
         tests: add missing double quotes to included library paths
     
    -    Fix two inclusions added in d42bab442d7 (core.fsyncmethod: tests for
    -    batch mode, 2022-04-04) that needed to be quoted, and the same sort of
    -    issue in a242c150ebb (vimdiff: integrate layout tests in the unit
    -    tests framework ('t' folder), 2022-03-30). Both were first released
    -    with v2.37.0-rc0.
    +    Fix inclusion errors which would occur if the $TEST_DIRECTORY had $IFS
    +    whitespace in it.
    +
    +    See d42bab442d7 (core.fsyncmethod: tests for batch mode, 2022-04-04)
    +    and a242c150ebb (vimdiff: integrate layout tests in the unit tests
    +    framework ('t' folder), 2022-03-30) for the two relevant commits. Both
    +    were first released with v2.37.0-rc0 (and were also part of v2.37.0).
     
         Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>
     
2:  e06bf0cdfbe = 2:  b56ededf1b8 test-lib.sh: fix prepend_var() quoting issue
3:  f787b19f8c2 ! 3:  d3f65326701 config tests: fix harmless but broken "rm -r" cleanup
    @@ Commit message
         fail to remove an existing directory, but in practice that probably
         never happened.
     
    +    Let's fix both the quoting issue, and the other issue cleanup issue in
    +    4179b4897f2, which is that we were attempting to clean up
    +    ~/.config/git, but weren't cleaing up ~/.gitconfig.
    +
         Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>
     
      ## t/t1300-config.sh ##
    @@ t/t1300-config.sh: test_expect_success '--show-scope with --show-origin' '
      
      test_expect_success 'override global and system config' '
     -	test_when_finished rm -f "$HOME"/.config/git &&
    -+	test_when_finished "rm -rf \"$HOME\"/.config/git" &&
    - 
    +-
    ++	test_when_finished rm -f \"\$HOME\"/.gitconfig &&
      	cat >"$HOME"/.gitconfig <<-EOF &&
      	[home]
    + 		config = true
    + 	EOF
    ++
    ++	test_when_finished rm -rf \"\$HOME\"/.config/git &&
    + 	mkdir -p "$HOME"/.config/git &&
    + 	cat >"$HOME"/.config/git/config <<-EOF &&
    + 	[xdg]
-- 
2.37.0.880.gf07d56b18ba
Previous: Junio C HamanoNext: Ævar Arnfjörð Bjarmason
Message 8 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.