Rename sha1_array to oid_array

Since this structure handles an array of object IDs, rename it to struct
oid_array.  Also rename the accessor functions and the initialization
constant.

This commit was produced mechanically by providing non-Documentation
files to the following Perl one-liners:

    perl -pi -E 's/struct sha1_array/struct oid_array/g'
    perl -pi -E 's/\bsha1_array_/oid_array_/g'
    perl -pi -E 's/SHA1_ARRAY_INIT/OID_ARRAY_INIT/g'

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:40:00 +00:00
committed by Junio C Hamano
parent 1b7ba794d2
commit 910650d2f8
31 changed files with 155 additions and 155 deletions

View File

@ -831,7 +831,7 @@ static int command_singleton_iterator(void *cb_data, unsigned char sha1[20]);
static int update_shallow_ref(struct command *cmd, struct shallow_info *si)
{
static struct lock_file shallow_lock;
struct sha1_array extra = SHA1_ARRAY_INIT;
struct oid_array extra = OID_ARRAY_INIT;
struct check_connected_options opt = CHECK_CONNECTED_INIT;
uint32_t mask = 1 << (cmd->index % 32);
int i;
@ -842,13 +842,13 @@ static int update_shallow_ref(struct command *cmd, struct shallow_info *si)
if (si->used_shallow[i] &&
(si->used_shallow[i][cmd->index / 32] & mask) &&
!delayed_reachability_test(si, i))
sha1_array_append(&extra, &si->shallow->oid[i]);
oid_array_append(&extra, &si->shallow->oid[i]);
opt.env = tmp_objdir_env(tmp_objdir);
setup_alternate_shallow(&shallow_lock, &opt.shallow_file, &extra);
if (check_connected(command_singleton_iterator, cmd, &opt)) {
rollback_lock_file(&shallow_lock);
sha1_array_clear(&extra);
oid_array_clear(&extra);
return -1;
}
@ -862,7 +862,7 @@ static int update_shallow_ref(struct command *cmd, struct shallow_info *si)
register_shallow(extra.oid[i].hash);
si->shallow_ref[cmd->index] = 0;
sha1_array_clear(&extra);
oid_array_clear(&extra);
return 0;
}
@ -1529,7 +1529,7 @@ static void queue_commands_from_cert(struct command **tail,
}
}
static struct command *read_head_info(struct sha1_array *shallow)
static struct command *read_head_info(struct oid_array *shallow)
{
struct command *commands = NULL;
struct command **p = &commands;
@ -1546,7 +1546,7 @@ static struct command *read_head_info(struct sha1_array *shallow)
if (get_oid_hex(line + 8, &oid))
die("protocol error: expected shallow sha, got '%s'",
line + 8);
sha1_array_append(shallow, &oid);
oid_array_append(shallow, &oid);
continue;
}
@ -1804,7 +1804,7 @@ static void prepare_shallow_update(struct command *commands,
static void update_shallow_info(struct command *commands,
struct shallow_info *si,
struct sha1_array *ref)
struct oid_array *ref)
{
struct command *cmd;
int *ref_status;
@ -1817,7 +1817,7 @@ static void update_shallow_info(struct command *commands,
for (cmd = commands; cmd; cmd = cmd->next) {
if (is_null_oid(&cmd->new_oid))
continue;
sha1_array_append(ref, &cmd->new_oid);
oid_array_append(ref, &cmd->new_oid);
cmd->index = ref->nr - 1;
}
si->ref = ref;
@ -1878,8 +1878,8 @@ int cmd_receive_pack(int argc, const char **argv, const char *prefix)
{
int advertise_refs = 0;
struct command *commands;
struct sha1_array shallow = SHA1_ARRAY_INIT;
struct sha1_array ref = SHA1_ARRAY_INIT;
struct oid_array shallow = OID_ARRAY_INIT;
struct oid_array ref = OID_ARRAY_INIT;
struct shallow_info si;
struct option options[] = {
@ -1971,8 +1971,8 @@ int cmd_receive_pack(int argc, const char **argv, const char *prefix)
}
if (use_sideband)
packet_flush(1);
sha1_array_clear(&shallow);
sha1_array_clear(&ref);
oid_array_clear(&shallow);
oid_array_clear(&ref);
free((void *)push_cert_nonce);
return 0;
}