From: Junio C Hamano Date: Tue, 28 Jan 2020 23:16:02 GMT Subject: Re: [PATCH] Make git rm submodule succeed if .gitmodules index stat info is zero Message-ID: In-Reply-To: <20200127185856.2619317-1-dturner@twosigma.com> David Turner 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. > +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 &&