This will allow us to later skip unmodified entries added due to "-C -C".
We might also want to do something similar to rename_dst side, but that
would only be for the sake of symmetry and not necessary for this series.
Signed-off-by: Junio C Hamano <gitster@pobox.com>
memmove(rename_src + first + 1, rename_src + first,
(rename_src_nr - first - 1) * sizeof(*rename_src));
rename_src[first].one = one;
rename_src[first].p = p;
rename_src[first].score = score;
return &(rename_src[first]);
}
@ -205,7 +206,7 @@ static void record_rename_pair(int dst_index, int src_index, int score)
@@ -205,7 +206,7 @@ static void record_rename_pair(int dst_index, int src_index, int score)
if (rename_dst[dst_index].pair)
die("internal error: dst already matched.");
src = rename_src[src_index].one;
src = rename_src[src_index].p->one;
src->rename_used++;
src->count++;
@ -389,7 +390,7 @@ static int find_exact_renames(struct diff_options *options)
@@ -389,7 +390,7 @@ static int find_exact_renames(struct diff_options *options)
init_hash(&file_table);
for (i = 0; i < rename_src_nr; i++)
insert_file_table(&file_table, -1, i, rename_src[i].one);
insert_file_table(&file_table, -1, i, rename_src[i].p->one);
for (i = 0; i < rename_dst_nr; i++)
insert_file_table(&file_table, 1, i, rename_dst[i].two);
@ -460,7 +461,7 @@ static int find_renames(struct diff_score *mx, int dst_cnt, int minimum_score, i
@@ -460,7 +461,7 @@ static int find_renames(struct diff_score *mx, int dst_cnt, int minimum_score, i
dst = &rename_dst[mx[i].dst];
if (dst->pair)
continue; /* already done, either exact or fuzzy. */
if (!copies && rename_src[mx[i].src].one->rename_used)
if (!copies && rename_src[mx[i].src].p->one->rename_used)