Re: [PATCH v2] diff-lib.c: adjust position of i-t-a entries in diff
- From
Junio C Hamano <gitster@pobox.com>
- Date
- Mar 16, 2015, 16:05 UTC
- Message-ID
- <xmqqa8zdrkpy.fsf@gitster.dls.corp.google.com>
- In-Reply-To
- <5506F3A9.1020704@drmicha.warpmail.net>
Michael J Gruber <git@drmicha.warpmail.net> writes:
Show 11 quoted lines
> Nguyễn Thái Ngọc Duy venit, vidit, dixit 16.03.2015 14:56: > >> The test "cache-tree invalidates i-t-a paths" is marked failure >> because I don't think removing "--cached" from "git diff" is the right >> fix. This test relies on "diff --cached" behavior but the behavior now >> has changed. We may need to revisit this test at some point in future. > > I can't quite follow that reasoning. If the test describes expected > behavior which the patch breaks, then we should not apply the patch. If > the patch changes behavior in an expected way, then we should change the > test to match.
The offending one came from eec3e7e4 (cache-tree: invalidate i-t-a paths after generating trees, 2012-12-16), which was a fix to an earlier bug where a cache-tree written out of an index with i-t-a entries had incorrect information and still claimed it is fully valid after write-tree rebuilt it. The test probably should add another path without i-t-a bit, run the same "diff --cached" with updated expectation before write-tre, and run the "diff --cached" again to make sure it produces a result that match the updated expectation.