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

Re: [Bug] Temp file use in t0018.6

From
Junio C Hamano <gitster@pobox.com>
Date
Aug 1, 2024, 18:34 UTC
Message-ID
<xmqqbk2cum5o.fsf@gitster.g>
In-Reply-To
<02d401dae43e$c076b000$41641000$@nexbridge.com>
<rsbecker@nexbridge.com> writes:
Show 27 quoted lines
> In the 2.46.0 test suite on NonStop I'm getting the following surprise
> error:
>
> expecting success of 0018.6 'advice should be printed when GIT_ADVICE is set
> to true':
>         q_to_tab >expect <<-\EOF &&
>         On branch trunk
>
>         No commits yet
>
>         Untracked files:
>           (use "git add <file>..." to include in what will be committed)
>         QREADME
>
>         nothing added to commit but untracked files present (use "git add"
> to track)
>         EOF
>
>         test_when_finished "rm -fr advice-test" &&
>         git init advice-test &&
>         (
>                 cd advice-test &&
>                 >README &&
>                 GIT_ADVICE=true git status
>         ) >actual &&
>         cat actual > /tmp/actual &&
>         test_cmp expect actual
Sheesh.

We should *not* be assuming what is in /tmp. Our TMPDIR may not even be set to point at /tmp. Anybody can create directory 'actual' there and break this test.

I thought this was a left-over debugging copy while reviewing the patch, and I thought I had pointed it out to the author and/or I removed it while queuing it. The copy to /tmp/actual with cat should be removed.

Thanks for noticing. Are there other reference to /tmp in our test suite I have to wonder...

Previous: rsbecker@nexbridge.comNext: Junio C Hamano
Message 2 of 6 in “[Bug] Temp file use in t0018.6”
  1. rsbecker@nexbridge.comAug 1, 2024
  2. Junio C HamanoAug 1, 2024
  3. t0018: remove leftover debugging cruftJunio C Hamano, Aug 1, 2024
  4. rsbecker@nexbridge.comAug 1, 2024
  5. rsbecker@nexbridge.comAug 1, 2024
  6. Jeff KingAug 2, 2024

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.