Skip to content

Commit e3de888

Browse files
newrengitster
authored andcommitted
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 <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent 259ccb6 commit e3de888

File tree

1 file changed

+23
-23
lines changed

1 file changed

+23
-23
lines changed

merge-recursive.c

Lines changed: 23 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -1050,7 +1050,7 @@ struct merge_file_info {
10501050

10511051
static int merge_3way(struct merge_options *opt,
10521052
mmbuffer_t *result_buf,
1053-
const struct diff_filespec *one,
1053+
const struct diff_filespec *o,
10541054
const struct diff_filespec *a,
10551055
const struct diff_filespec *b,
10561056
const char *branch1,
@@ -1084,9 +1084,9 @@ static int merge_3way(struct merge_options *opt,
10841084
}
10851085

10861086
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)) {
10881088
base_name = opt->ancestor == NULL ? NULL :
1089-
mkpathdup("%s:%s", opt->ancestor, one->path);
1089+
mkpathdup("%s:%s", opt->ancestor, o->path);
10901090
name1 = mkpathdup("%s:%s", branch1, a->path);
10911091
name2 = mkpathdup("%s:%s", branch2, b->path);
10921092
} else {
@@ -1096,7 +1096,7 @@ static int merge_3way(struct merge_options *opt,
10961096
name2 = mkpathdup("%s", branch2);
10971097
}
10981098

1099-
read_mmblob(&orig, &one->oid);
1099+
read_mmblob(&orig, &o->oid);
11001100
read_mmblob(&src1, &a->oid);
11011101
read_mmblob(&src2, &b->oid);
11021102

@@ -1295,7 +1295,7 @@ static int merge_submodule(struct merge_options *opt,
12951295
}
12961296

12971297
static int merge_mode_and_contents(struct merge_options *opt,
1298-
const struct diff_filespec *one,
1298+
const struct diff_filespec *o,
12991299
const struct diff_filespec *a,
13001300
const struct diff_filespec *b,
13011301
const char *filename,
@@ -1310,7 +1310,7 @@ static int merge_mode_and_contents(struct merge_options *opt,
13101310
* side of the conflict markers and the other branch on the
13111311
* top. Fix that.
13121312
*/
1313-
return merge_mode_and_contents(opt, one, b, a,
1313+
return merge_mode_and_contents(opt, o, b, a,
13141314
filename,
13151315
branch2, branch1,
13161316
extra_marker_size, result);
@@ -1329,31 +1329,31 @@ static int merge_mode_and_contents(struct merge_options *opt,
13291329
oidcpy(&result->oid, &b->oid);
13301330
}
13311331
} 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))
13331333
result->merge = 1;
13341334

13351335
/*
13361336
* Merge modes
13371337
*/
1338-
if (a->mode == b->mode || a->mode == one->mode)
1338+
if (a->mode == b->mode || a->mode == o->mode)
13391339
result->mode = b->mode;
13401340
else {
13411341
result->mode = a->mode;
1342-
if (b->mode != one->mode) {
1342+
if (b->mode != o->mode) {
13431343
result->clean = 0;
13441344
result->merge = 1;
13451345
}
13461346
}
13471347

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))
13491349
oidcpy(&result->oid, &b->oid);
1350-
else if (oid_eq(&b->oid, &one->oid))
1350+
else if (oid_eq(&b->oid, &o->oid))
13511351
oidcpy(&result->oid, &a->oid);
13521352
else if (S_ISREG(a->mode)) {
13531353
mmbuffer_t result_buf;
13541354
int ret = 0, merge_status;
13551355

1356-
merge_status = merge_3way(opt, &result_buf, one, a, b,
1356+
merge_status = merge_3way(opt, &result_buf, o, a, b,
13571357
branch1, branch2,
13581358
extra_marker_size);
13591359

@@ -1372,8 +1372,8 @@ static int merge_mode_and_contents(struct merge_options *opt,
13721372
result->clean = (merge_status == 0);
13731373
} else if (S_ISGITLINK(a->mode)) {
13741374
result->clean = merge_submodule(opt, &result->oid,
1375-
one->path,
1376-
&one->oid,
1375+
o->path,
1376+
&o->oid,
13771377
&a->oid,
13781378
&b->oid);
13791379
} else if (S_ISLNK(a->mode)) {
@@ -1750,21 +1750,21 @@ static int handle_rename_rename_1to2(struct merge_options *opt,
17501750
struct merge_file_info mfi;
17511751
struct diff_filespec other;
17521752
struct diff_filespec *add;
1753-
struct diff_filespec *one = ci->pair1->one;
1753+
struct diff_filespec *o = ci->pair1->one;
17541754
struct diff_filespec *a = ci->pair1->two;
17551755
struct diff_filespec *b = ci->pair2->two;
17561756
char *path_desc;
17571757

17581758
output(opt, 1, _("CONFLICT (rename/rename): "
17591759
"Rename \"%s\"->\"%s\" in branch \"%s\" "
17601760
"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,
17631763
opt->call_depth ? _(" (left unresolved)") : "");
17641764

17651765
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,
17681768
ci->branch1, ci->branch2,
17691769
opt->call_depth * 2, &mfi))
17701770
return -1;
@@ -1777,7 +1777,7 @@ static int handle_rename_rename_1to2(struct merge_options *opt,
17771777
* pathname and then either rename the add-source file to that
17781778
* unique path, or use that unique path instead of src here.
17791779
*/
1780-
if (update_file(opt, 0, &mfi.oid, mfi.mode, one->path))
1780+
if (update_file(opt, 0, &mfi.oid, mfi.mode, o->path))
17811781
return -1;
17821782

17831783
/*
@@ -2863,18 +2863,18 @@ static int process_renames(struct merge_options *opt,
28632863
if (clean_merge < 0)
28642864
goto cleanup_and_return;
28652865
if (try_merge) {
2866-
struct diff_filespec *one, *a, *b;
2866+
struct diff_filespec *o, *a, *b;
28672867
src_other.path = (char *)ren1_src;
28682868

2869-
one = ren1->pair->one;
2869+
o = ren1->pair->one;
28702870
if (a_renames == renames1) {
28712871
a = ren1->pair->two;
28722872
b = &src_other;
28732873
} else {
28742874
b = ren1->pair->two;
28752875
a = &src_other;
28762876
}
2877-
update_entry(ren1->dst_entry, one, a, b);
2877+
update_entry(ren1->dst_entry, o, a, b);
28782878
setup_rename_conflict_info(RENAME_NORMAL,
28792879
ren1->pair,
28802880
NULL,

0 commit comments

Comments
 (0)