Skip to content

Commit 93a02c5

Browse files
newrengitster
authored andcommitted
merge-recursive: rename locals 'o' and 'a' to 'obuf' and 'abuf'
Since we want to replace oid,mode pairs with a single diff_filespec, we will soon want to be able to use the names 'o', 'a', and 'b' for the three different file versions. Rename some local variables in blob_unchanged() that would otherwise conflict. Signed-off-by: Elijah Newren <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent e3de888 commit 93a02c5

File tree

1 file changed

+10
-8
lines changed

1 file changed

+10
-8
lines changed

merge-recursive.c

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -3031,9 +3031,10 @@ static int blob_unchanged(struct merge_options *opt,
30313031
unsigned a_mode,
30323032
int renormalize, const char *path)
30333033
{
3034-
struct strbuf o = STRBUF_INIT;
3035-
struct strbuf a = STRBUF_INIT;
3034+
struct strbuf obuf = STRBUF_INIT;
3035+
struct strbuf abuf = STRBUF_INIT;
30363036
int ret = 0; /* assume changed for safety */
3037+
const struct index_state *idx = opt->repo->index;
30373038

30383039
if (a_mode != o_mode)
30393040
return 0;
@@ -3043,20 +3044,21 @@ static int blob_unchanged(struct merge_options *opt,
30433044
return 0;
30443045

30453046
assert(o_oid && a_oid);
3046-
if (read_oid_strbuf(opt, o_oid, &o) || read_oid_strbuf(opt, a_oid, &a))
3047+
if (read_oid_strbuf(opt, o_oid, &obuf) ||
3048+
read_oid_strbuf(opt, a_oid, &abuf))
30473049
goto error_return;
30483050
/*
30493051
* Note: binary | is used so that both renormalizations are
30503052
* performed. Comparison can be skipped if both files are
30513053
* unchanged since their sha1s have already been compared.
30523054
*/
3053-
if (renormalize_buffer(opt->repo->index, path, o.buf, o.len, &o) |
3054-
renormalize_buffer(opt->repo->index, path, a.buf, a.len, &a))
3055-
ret = (o.len == a.len && !memcmp(o.buf, a.buf, o.len));
3055+
if (renormalize_buffer(idx, path, obuf.buf, obuf.len, &obuf) |
3056+
renormalize_buffer(idx, path, abuf.buf, abuf.len, &abuf))
3057+
ret = (obuf.len == abuf.len && !memcmp(obuf.buf, abuf.buf, obuf.len));
30563058

30573059
error_return:
3058-
strbuf_release(&o);
3059-
strbuf_release(&a);
3060+
strbuf_release(&obuf);
3061+
strbuf_release(&abuf);
30603062
return ret;
30613063
}
30623064

0 commit comments

Comments
 (0)