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:

committed by
Junio C Hamano

parent
ee3051bd23
commit
98a72ddc12
@ -842,7 +842,7 @@ 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].hash);
|
||||
sha1_array_append(&extra, &si->shallow->oid[i]);
|
||||
|
||||
opt.env = tmp_objdir_env(tmp_objdir);
|
||||
setup_alternate_shallow(&shallow_lock, &opt.shallow_file, &extra);
|
||||
@ -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.hash);
|
||||
sha1_array_append(shallow, &oid);
|
||||
continue;
|
||||
}
|
||||
|
||||
@ -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.hash);
|
||||
sha1_array_append(ref, &cmd->new_oid);
|
||||
cmd->index = ref->nr - 1;
|
||||
}
|
||||
si->ref = ref;
|
||||
|
Reference in New Issue
Block a user