summaryrefslogtreecommitdiff
path: root/diffcore.h
diff options
context:
space:
mode:
authorJunio C Hamano <junkio@cox.net>2006-08-03 19:01:01 (GMT)
committerJunio C Hamano <junkio@cox.net>2006-08-03 21:41:53 (GMT)
commitef677686efe1868432d3cc9d4c41a93b44f3def8 (patch)
treef4ba8f6c1117bd4a9c62257150ad0bb28d413e85 /diffcore.h
parentc43ce6d603c68f716f83f1da68cc4692202085e0 (diff)
downloadgit-ef677686efe1868432d3cc9d4c41a93b44f3def8.zip
git-ef677686efe1868432d3cc9d4c41a93b44f3def8.tar.gz
git-ef677686efe1868432d3cc9d4c41a93b44f3def8.tar.bz2
diff.c: do not use pathname comparison to tell renames
The final output from diff used to compare pathnames between preimage and postimage to tell if the filepair is a rename/copy. By explicitly marking the filepair created by diffcore_rename(), the output routine, resolve_rename_copy(), does not have to do so anymore. This helps feeding a filepair that has different pathnames in one and two elements to the diff machinery (most notably, comparing two blobs). Signed-off-by: Junio C Hamano <junkio@cox.net>
Diffstat (limited to 'diffcore.h')
-rw-r--r--diffcore.h3
1 files changed, 2 insertions, 1 deletions
diff --git a/diffcore.h b/diffcore.h
index 73c7842..2249bc2 100644
--- a/diffcore.h
+++ b/diffcore.h
@@ -53,11 +53,12 @@ struct diff_filepair {
char status; /* M C R N D U (see Documentation/diff-format.txt) */
unsigned source_stays : 1; /* all of R/C are copies */
unsigned broken_pair : 1;
+ unsigned renamed_pair : 1;
};
#define DIFF_PAIR_UNMERGED(p) \
(!DIFF_FILE_VALID((p)->one) && !DIFF_FILE_VALID((p)->two))
-#define DIFF_PAIR_RENAME(p) (strcmp((p)->one->path, (p)->two->path))
+#define DIFF_PAIR_RENAME(p) ((p)->renamed_pair)
#define DIFF_PAIR_BROKEN(p) \
( (!DIFF_FILE_VALID((p)->one) != !DIFF_FILE_VALID((p)->two)) && \