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>
This commit is contained in:
6
diff.c
6
diff.c
@ -1786,13 +1786,9 @@ struct diff_filepair *diff_queue(struct diff_queue_struct *queue,
|
||||
struct diff_filespec *one,
|
||||
struct diff_filespec *two)
|
||||
{
|
||||
struct diff_filepair *dp = xmalloc(sizeof(*dp));
|
||||
struct diff_filepair *dp = xcalloc(1, sizeof(*dp));
|
||||
dp->one = one;
|
||||
dp->two = two;
|
||||
dp->score = 0;
|
||||
dp->status = 0;
|
||||
dp->source_stays = 0;
|
||||
dp->broken_pair = 0;
|
||||
if (queue)
|
||||
diff_q(queue, dp);
|
||||
return dp;
|
||||
|
||||
Reference in New Issue
Block a user