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 &&