Re: [PATCH] Re-re-re-fix common tail optimization
From: Junio C Hamano <hidden>
Date: 2016-06-15 22:43:59
Jeff King [off-list ref] writes:
This would probably work better as 'cat'.
Yeah, I amended it without adding another "re-" to the title ;-) The result has been already pushed out.
quoted
+test_expect_success 'diff -U0' ' + + git diff -U0 | sed -e "/^index/d" -e "s/$z2047/Z/g" >actual && + diff -u expect actualAren't we using "git diff" for the second diff there nowadays?
Some people seem to think that is a good idea, but I generally do not like using "git diff" between expect and actual (both untracked) inside tests. The last "diff" is about validating what git does and using "git diff" there would make the test meaningless when "git diff" itself is broken. This is especially so because comparison between untracked files is a bolted-on afterthought and I am least confident about among the codepaths in the whole "git diff" (it is not even my nor Linus's code).