author | Junio C Hamano <gitster@pobox.com> | |
Thu, 4 Aug 2011 18:39:10 +0000 (11:39 -0700) | ||
committer | Junio C Hamano <gitster@pobox.com> | |
Thu, 4 Aug 2011 19:05:47 +0000 (12:05 -0700) | ||
commit | 99694544358b74c14982f2b9769f8804f017672c | |
tree | 22d10c5f840ee9a7f9de07ff1da88cb06ea49a91 | tree | snapshot |
parent | 206af7c96b134b4962fa04fa174a25f29efd7e5e | commit | diff |
diff -c/--cc: do not mistake "resolved as deletion" as "use working tree"
The combined diff machinery can be used to compare:
- a merge commit with its parent commits;
- a working-tree file with multiple stages in an unmerged index; or
- a working-tree file with the HEAD and the index.
The internal function combine-diff.c:show_patch_diff() checked if it needs
to read the "result" from the working tree by looking at the object name
of the result --- if it is null_sha1, it read from the working tree.
This mistook a merge that records a deletion as the conflict resolution
as if it is a cue to read from the working tree. Pass this information
explicitly from the caller instead.
Noticed and reported by Johan Herland.
Signed-off-by: Junio C Hamano <gitster@pobox.com>
The combined diff machinery can be used to compare:
- a merge commit with its parent commits;
- a working-tree file with multiple stages in an unmerged index; or
- a working-tree file with the HEAD and the index.
The internal function combine-diff.c:show_patch_diff() checked if it needs
to read the "result" from the working tree by looking at the object name
of the result --- if it is null_sha1, it read from the working tree.
This mistook a merge that records a deletion as the conflict resolution
as if it is a cue to read from the working tree. Pass this information
explicitly from the caller instead.
Noticed and reported by Johan Herland.
Signed-off-by: Junio C Hamano <gitster@pobox.com>
combine-diff.c | diff | blob | history |