From e9c8409900fc84cd7721117c98dfe01acd535aa2 Mon Sep 17 00:00:00 2001 From: Junio C Hamano Date: Fri, 5 Jan 2007 01:25:18 -0800 Subject: diff-index --cached --raw: show tree entry on the LHS for unmerged entries. This updates the way diffcore represents an unmerged pair somewhat. It used to be that entries with mode=0 on both sides were used to represent an unmerged pair, but now it has an explicit flag. This is to allow diff-index --cached to report the entry from the tree when the path is unmerged in the index. This is used in updating "git reset -- " to restore absense of the path in the index from the tree. Signed-off-by: Junio C Hamano --- diffcore.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'diffcore.h') diff --git a/diffcore.h b/diffcore.h index 2249bc2c05..1ea80671e3 100644 --- a/diffcore.h +++ b/diffcore.h @@ -54,9 +54,9 @@ struct diff_filepair { unsigned source_stays : 1; /* all of R/C are copies */ unsigned broken_pair : 1; unsigned renamed_pair : 1; + unsigned is_unmerged : 1; }; -#define DIFF_PAIR_UNMERGED(p) \ - (!DIFF_FILE_VALID((p)->one) && !DIFF_FILE_VALID((p)->two)) +#define DIFF_PAIR_UNMERGED(p) ((p)->is_unmerged) #define DIFF_PAIR_RENAME(p) ((p)->renamed_pair) -- cgit v1.2.3