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

Re: [PATCH v6] read-cache: force_verify_index_checksum

From
Jonathan Nieder <jrnieder@gmail.com>
Date
Apr 5, 2017, 18:41 UTC
Message-ID
<20170405184119.GF8741@aiede.mtv.corp.google.com>
In-Reply-To
<20170405180625.12439-2-git@jeffhostetler.com>
Hi,
git@jeffhostetler.com wrote:
Show 15 quoted lines
> --- a/t/t1450-fsck.sh
> +++ b/t/t1450-fsck.sh
> @@ -689,4 +689,17 @@ test_expect_success 'bogus head does not fallback to all heads' '
>  	! grep $blob out
>  '
>  
> +test_expect_success 'detect corrupt index file in fsck' '
> +	cp .git/index .git/index.backup &&
> +	test_when_finished "mv .git/index.backup .git/index" &&
> +	echo zzzzzzzz >zzzzzzzz &&
> +	test_when_finished "rm zzzzzzzz" &&
> +	git add zzzzzzzz &&
> +	sed -e "s/zzzzzzzz/yyyyyyyy/" .git/index >.git/index.yyy &&
> +	rm .git/index &&
> +	mv .git/index.yyy .git/index &&

Why is the "rm" before "mv" needed? I would have expected "mv" to replace the file.

If that doesn't work, I expect there are a large number of other tests that would need fixing...

> +	test_when_finished "rm .git/index" &&
Likewise --- this seems redundant next to the "mv" enqueued previously.
> +	test_must_fail git fsck --cache
That said,
Reviewed-by: Jonathan Nieder <jrnieder@gmail.com>
Previous: Jeff Hostetler
Message 5 of 5 in “read-cache: call verify_hdr() in a background thread”
  1. read-cache: call verify_hdr() in a background threadgit@jeffhostetler.com, Apr 5, 2017
  2. read-cache: force_verify_index_checksumgit@jeffhostetler.com, Apr 5, 2017
  3. Jeff KingApr 5, 2017
  4. Jeff HostetlerApr 5, 2017
  5. Jonathan NiederApr 5, 2017

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.