@matheusbsbs / matheus-bagliano / commits / 36de17048a
Fork 0

merge-recursive: Update conflict_rename_rename_1to2() call signature

To facilitate having this function called later using information stored in a rename_df_conflict_info struct, accept a diff_filepair instead of a rename. Signed-off-by: Elijah Newren <newren@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>

Elijah Newren committed Sep 20, 2010 at 02:28 UTC 36de17048aaa3c3011c8b4ee1f89ee65b7ad2f99
1 file changed +9 -9
merge-recursive.c
+9 -9
@@ -821,16 +821,16 @@ static void conflict_rename_delete(struct merge_options *o,
821 }
822
823 static void conflict_rename_rename_1to2(struct merge_options *o,
824 - struct rename *ren1,
824 + struct diff_filepair *pair1,
825 const char *branch1,
826 - struct rename *ren2,
826 + struct diff_filepair *pair2,
827 const char *branch2)
828 {
829 /* One file was renamed in both branches, but to different names. */
830 char *del[2];
831 int delp = 0;
832 - const char *ren1_dst = ren1->pair->two->path;
833 - const char *ren2_dst = ren2->pair->two->path;
832 + const char *ren1_dst = pair1->two->path;
833 + const char *ren2_dst = pair2->two->path;
834 const char *dst_name1 = ren1_dst;
835 const char *dst_name2 = ren2_dst;
836 if (string_list_has_string(&o->current_directory_set, ren1_dst)) {
@@ -851,12 +851,12 @@ static void conflict_rename_rename_1to2(struct merge_options *o,
851 /*
852 * Uncomment to leave the conflicting names in the resulting tree
853 *
854 - * update_file(o, 0, ren1->pair->two->sha1, ren1->pair->two->mode, dst_name1);
855 - * update_file(o, 0, ren2->pair->two->sha1, ren2->pair->two->mode, dst_name2);
854 + * update_file(o, 0, pair1->two->sha1, pair1->two->mode, dst_name1);
855 + * update_file(o, 0, pair2->two->sha1, pair2->two->mode, dst_name2);
856 */
857 } else {
858 - update_stages(dst_name1, NULL, ren1->pair->two, NULL, 1);
859 - update_stages(dst_name2, NULL, NULL, ren2->pair->two, 1);
858 + update_stages(dst_name1, NULL, pair1->two, NULL, 1);
859 + update_stages(dst_name2, NULL, NULL, pair2->two, 1);
860 }
861 while (delp--)
862 free(del[delp]);
@@ -970,7 +970,7 @@ static int process_renames(struct merge_options *o,
970 update_file(o, 0, ren1->pair->one->sha1,
971 ren1->pair->one->mode, src);
972 }
973 - conflict_rename_rename_1to2(o, ren1, branch1, ren2, branch2);
973 + conflict_rename_rename_1to2(o, ren1->pair, branch1, ren2->pair, branch2);
974 } else {
975 struct merge_file_info mfi;
976 remove_file(o, 1, ren1_src, 1);