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

Re: [PATCH] Make git rm submodule succeed if .gitmodules index stat info is zero

From
Junio C Hamano <gitster@pobox.com>
Date
Jan 28, 2020, 23:16 UTC
Message-ID
<xmqqftfz6ukt.fsf@gitster-ct.c.googlers.com>
In-Reply-To
<20200127185856.2619317-1-dturner@twosigma.com>
David Turner <dturner@twosigma.com> writes:
> The bug was that ie_match_stat was used to compare if the stat info
> for the file was compatible with the stat info in the index, rather
> using ie_modified to check if the file was in fact different from the
> version in the index.

Makes sense. ie_match_stat() often ends up comparing the file contents in our tests due to sequence Git commands firing too rapidly, leading to a racy-index status, but read-tree is a reliable way to clear the cached stat information to force it say "I dunno--- suspect it got modified". Will queue.

Show 10 quoted lines
> +test_expect_success 'rm will not error out on .gitmodules file with zero stat data' '
> +	git reset --hard &&
> +	git submodule update &&
> +	git read-tree HEAD &&
> +	git rm submod &&
> +	test_path_is_missing submod
> +'
>  
>  test_expect_success 'rm issues a warning when section is not found in .gitmodules' '
>  	git reset --hard &&
Previous: David Turner
Message 2 of 2 in “Make git rm submodule succeed if .gitmodules index stat info is zero”
  1. Make git rm submodule succeed if .gitmodules index stat info is zeroDavid Turner, Jan 27, 2020
  2. Junio C HamanoJan 28, 2020

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.