merge-recursive: rename diff_filespec 'one' to 'o'

In the previous commit, we noted that several places throughout merge recursive both had a reason to use 'o'; some for a merge_options struct, and others for a diff_filespec struct. Some places had both, forcing one of the two to be renamed, though the choice was inconsistent. Now that the merge_options struct has been renamed to 'opt' everywhere, we can replace the few places that used 'one' for the diff_filespec to 'o'. Signed-off-by: Elijah Newren <newren@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>

Elijah Newren committed Apr 5, 2019 at 08:00 UTC e3de888ca052f7962c1a2e2f83b4640c40847ab2
1 file changed +23 -23
merge-recursive.c
+23 -23
@@ -1050,7 +1050,7 @@ struct merge_file_info {
1050
1051 static int merge_3way(struct merge_options *opt,
1052 mmbuffer_t *result_buf,
1053 - const struct diff_filespec *one,
1053 + const struct diff_filespec *o,
1054 const struct diff_filespec *a,
1055 const struct diff_filespec *b,
1056 const char *branch1,
@@ -1084,9 +1084,9 @@ static int merge_3way(struct merge_options *opt,
1084 }
1085
1086 if (strcmp(a->path, b->path) ||
1087 - (opt->ancestor != NULL && strcmp(a->path, one->path) != 0)) {
1087 + (opt->ancestor != NULL && strcmp(a->path, o->path) != 0)) {
1088 base_name = opt->ancestor == NULL ? NULL :
1089 - mkpathdup("%s:%s", opt->ancestor, one->path);
1089 + mkpathdup("%s:%s", opt->ancestor, o->path);
1090 name1 = mkpathdup("%s:%s", branch1, a->path);
1091 name2 = mkpathdup("%s:%s", branch2, b->path);
1092 } else {
@@ -1096,7 +1096,7 @@ static int merge_3way(struct merge_options *opt,
1096 name2 = mkpathdup("%s", branch2);
1097 }
1098
1099 - read_mmblob(&orig, &one->oid);
1099 + read_mmblob(&orig, &o->oid);
1100 read_mmblob(&src1, &a->oid);
1101 read_mmblob(&src2, &b->oid);
1102
@@ -1295,7 +1295,7 @@ static int merge_submodule(struct merge_options *opt,
1295 }
1296
1297 static int merge_mode_and_contents(struct merge_options *opt,
1298 - const struct diff_filespec *one,
1298 + const struct diff_filespec *o,
1299 const struct diff_filespec *a,
1300 const struct diff_filespec *b,
1301 const char *filename,
@@ -1310,7 +1310,7 @@ static int merge_mode_and_contents(struct merge_options *opt,
1310 * side of the conflict markers and the other branch on the
1311 * top. Fix that.
1312 */
1313 - return merge_mode_and_contents(opt, one, b, a,
1313 + return merge_mode_and_contents(opt, o, b, a,
1314 filename,
1315 branch2, branch1,
1316 extra_marker_size, result);
@@ -1329,31 +1329,31 @@ static int merge_mode_and_contents(struct merge_options *opt,
1329 oidcpy(&result->oid, &b->oid);
1330 }
1331 } else {
1332 - if (!oid_eq(&a->oid, &one->oid) && !oid_eq(&b->oid, &one->oid))
1332 + if (!oid_eq(&a->oid, &o->oid) && !oid_eq(&b->oid, &o->oid))
1333 result->merge = 1;
1334
1335 /*
1336 * Merge modes
1337 */
1338 - if (a->mode == b->mode || a->mode == one->mode)
1338 + if (a->mode == b->mode || a->mode == o->mode)
1339 result->mode = b->mode;
1340 else {
1341 result->mode = a->mode;
1342 - if (b->mode != one->mode) {
1342 + if (b->mode != o->mode) {
1343 result->clean = 0;
1344 result->merge = 1;
1345 }
1346 }
1347
1348 - if (oid_eq(&a->oid, &b->oid) || oid_eq(&a->oid, &one->oid))
1348 + if (oid_eq(&a->oid, &b->oid) || oid_eq(&a->oid, &o->oid))
1349 oidcpy(&result->oid, &b->oid);
1350 - else if (oid_eq(&b->oid, &one->oid))
1350 + else if (oid_eq(&b->oid, &o->oid))
1351 oidcpy(&result->oid, &a->oid);
1352 else if (S_ISREG(a->mode)) {
1353 mmbuffer_t result_buf;
1354 int ret = 0, merge_status;
1355
1356 - merge_status = merge_3way(opt, &result_buf, one, a, b,
1356 + merge_status = merge_3way(opt, &result_buf, o, a, b,
1357 branch1, branch2,
1358 extra_marker_size);
1359
@@ -1372,8 +1372,8 @@ static int merge_mode_and_contents(struct merge_options *opt,
1372 result->clean = (merge_status == 0);
1373 } else if (S_ISGITLINK(a->mode)) {
1374 result->clean = merge_submodule(opt, &result->oid,
1375 - one->path,
1376 - &one->oid,
1375 + o->path,
1376 + &o->oid,
1377 &a->oid,
1378 &b->oid);
1379 } else if (S_ISLNK(a->mode)) {
@@ -1750,7 +1750,7 @@ static int handle_rename_rename_1to2(struct merge_options *opt,
1750 struct merge_file_info mfi;
1751 struct diff_filespec other;
1752 struct diff_filespec *add;
1753 - struct diff_filespec *one = ci->pair1->one;
1753 + struct diff_filespec *o = ci->pair1->one;
1754 struct diff_filespec *a = ci->pair1->two;
1755 struct diff_filespec *b = ci->pair2->two;
1756 char *path_desc;
@@ -1758,13 +1758,13 @@ static int handle_rename_rename_1to2(struct merge_options *opt,
1758 output(opt, 1, _("CONFLICT (rename/rename): "
1759 "Rename \"%s\"->\"%s\" in branch \"%s\" "
1760 "rename \"%s\"->\"%s\" in \"%s\"%s"),
1761 - one->path, a->path, ci->branch1,
1762 - one->path, b->path, ci->branch2,
1761 + o->path, a->path, ci->branch1,
1762 + o->path, b->path, ci->branch2,
1763 opt->call_depth ? _(" (left unresolved)") : "");
1764
1765 path_desc = xstrfmt("%s and %s, both renamed from %s",
1766 - a->path, b->path, one->path);
1767 - if (merge_mode_and_contents(opt, one, a, b, path_desc,
1766 + a->path, b->path, o->path);
1767 + if (merge_mode_and_contents(opt, o, a, b, path_desc,
1768 ci->branch1, ci->branch2,
1769 opt->call_depth * 2, &mfi))
1770 return -1;
@@ -1777,7 +1777,7 @@ static int handle_rename_rename_1to2(struct merge_options *opt,
1777 * pathname and then either rename the add-source file to that
1778 * unique path, or use that unique path instead of src here.
1779 */
1780 - if (update_file(opt, 0, &mfi.oid, mfi.mode, one->path))
1780 + if (update_file(opt, 0, &mfi.oid, mfi.mode, o->path))
1781 return -1;
1782
1783 /*
@@ -2863,10 +2863,10 @@ static int process_renames(struct merge_options *opt,
2863 if (clean_merge < 0)
2864 goto cleanup_and_return;
2865 if (try_merge) {
2866 - struct diff_filespec *one, *a, *b;
2866 + struct diff_filespec *o, *a, *b;
2867 src_other.path = (char *)ren1_src;
2868
2869 - one = ren1->pair->one;
2869 + o = ren1->pair->one;
2870 if (a_renames == renames1) {
2871 a = ren1->pair->two;
2872 b = &src_other;
@@ -2874,7 +2874,7 @@ static int process_renames(struct merge_options *opt,
2874 b = ren1->pair->two;
2875 a = &src_other;
2876 }
2877 - update_entry(ren1->dst_entry, one, a, b);
2877 + update_entry(ren1->dst_entry, o, a, b);
2878 setup_rename_conflict_info(RENAME_NORMAL,
2879 ren1->pair,
2880 NULL,