"git diff-index" broken in 'next'
- From
Junio C Hamano <gitster@pobox.com>
- Date
- Mar 11, 2008, 02:41 UTC
- Message-ID
- <7vk5kagexu.fsf_-_@gitster.siamese.dyndns.org>
- In-Reply-To
- <alpine.LFD.1.00.0803100735530.5896@woody.linux-foundation.org>
When you are in the middle of conflicted merge, it is useful to view "git diff" that compares the stage #2 and your work tree (which has conflict markers and both sides of the changes). This still works.
However, with the unpack_trees() update, another form of useful sanity check seems to be totally broken:
$ git diff HEAD -- $conflicted_file
This used to show the diff between the HEAD and the work tree, but not anymore. It shows a diff as if the whole file is gone, and that is because diff-lib.c::oneway_diff() gets idx==NULL from the caller for unmerged entries. It never reaches show_modified() codepath.
I think it is somewhere around ll. 280 in unpack_callback() that causes this, but I don't have time to dig this further for now.