Make sha1_array_append take a struct object_id *

Convert the callers to pass struct object_id by changing the function
declaration and definition and applying the following semantic patch:

@@
expression E1, E2;
@@
- sha1_array_append(E1, E2.hash)
+ sha1_array_append(E1, &E2)

@@
expression E1, E2;
@@
- sha1_array_append(E1, E2->hash)
+ sha1_array_append(E1, E2)

Signed-off-by: brian m. carlson <sandals@crustytoothpaste.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
This commit is contained in:
brian m. carlson
2017-03-31 01:39:56 +00:00
committed by Junio C Hamano
parent ee3051bd23
commit 98a72ddc12
17 changed files with 32 additions and 30 deletions

View File

@ -650,7 +650,7 @@ static void collect_submodules_from_diff(struct diff_queue_struct *q,
if (!S_ISGITLINK(p->two->mode))
continue;
commits = submodule_commits(submodules, p->two->path);
sha1_array_append(commits, p->two->oid.hash);
sha1_array_append(commits, &p->two->oid);
}
}
@ -817,7 +817,7 @@ static void submodule_collect_changed_cb(struct diff_queue_struct *q,
static int add_sha1_to_array(const char *ref, const struct object_id *oid,
int flags, void *data)
{
sha1_array_append(data, oid->hash);
sha1_array_append(data, oid);
return 0;
}
@ -828,7 +828,7 @@ void check_for_new_submodule_commits(struct object_id *oid)
initialized_fetch_ref_tips = 1;
}
sha1_array_append(&ref_tips_after_fetch, oid->hash);
sha1_array_append(&ref_tips_after_fetch, oid);
}
static int add_sha1_to_argv(const unsigned char sha1[20], void *data)