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

Re: [PATCH 2/3] t1092: fix buggy sparse "blame" test

From
Derrick Stolee <derrickstolee@github.com>
Date
Aug 22, 2022, 20:09 UTC
Message-ID
<39b64f22-702a-80f0-af5d-50bb2dcdddfc@github.com>
In-Reply-To
<7b0784056f3cc0c96e9543ae44d0f5a7b0bf85fa.1661192802.git.gitgitgadget@gmail.com>
On 8/22/2022 2:26 PM, Eric Sunshine via GitGitGadget wrote:
Show 14 quoted lines
> From: Eric Sunshine <sunshine@sunshineco.com>
> 
> This test wants to verify that `git blame` errors out when asked to
> blame a file _not_ in the sparse checkout. However, the very first file
> it asks to blame _is_ present in the checkout, thus `test_must_fail git
> blame $file` gives an unexpected result (the "blame" succeeds). This
> problem went unnoticed because the test invokes `test_must_fail git
> blame $file` in loop but forgets to break out of the loop early upon
> failure, thus the failure gets swallowed.
> 
> Fix the test by having it not ask to blame a file present in the sparse
> checkout, and instead only blame files not present, as intended. While
> at it, also add the missing `|| return 1` which allowed this bug to go
> unnoticed.
Thank you for catching this!
-Stolee
Previous: Eric Sunshine via GitGitGadgetNext: Eric Sunshine via GitGitGadget
Message 4 of 10 in “tests: fix broken &&-chains & abort loops on error”
  1. 0/3 tests: fix broken &&-chains & abort loops on errorEric Sunshine via GitGitGadget, Aug 22, 2022
  2. 1/3 t2407: fix broken &&-chains in compound statementEric Sunshine via GitGitGadget, Aug 22, 2022
  3. 2/3 t1092: fix buggy sparse "blame" testEric Sunshine via GitGitGadget, Aug 22, 2022
  4. Derrick StoleeAug 22, 2022
  5. 3/3 t: detect and signal failure within loopEric Sunshine via GitGitGadget, Aug 22, 2022
  6. Junio C HamanoAug 22, 2022
  7. Junio C HamanoAug 22, 2022
  8. Johannes SixtAug 23, 2022
  9. Elijah NewrenAug 23, 2022
  10. Eric SunshineAug 28, 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.