diff options
author | brian m. carlson <sandals@crustytoothpaste.net> | 2017-03-26 16:01:37 +0000 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2017-03-28 09:59:34 -0700 |
commit | ee3051bd2307cdc0145aa9ed9dcacb8acfc08c40 (patch) | |
tree | 34c83024d11dbd1de894fc8d1e92a9714b30c463 /fetch-pack.c | |
parent | builtin/pull: convert to struct object_id (diff) | |
download | tgif-ee3051bd2307cdc0145aa9ed9dcacb8acfc08c40.tar.xz |
sha1-array: convert internal storage for struct sha1_array to object_id
Make the internal storage for struct sha1_array use an array of struct
object_id internally. Update the users of this struct which inspect its
internals.
Signed-off-by: brian m. carlson <sandals@crustytoothpaste.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'fetch-pack.c')
-rw-r--r-- | fetch-pack.c | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/fetch-pack.c b/fetch-pack.c index d07d85ce30..543e8aa9e1 100644 --- a/fetch-pack.c +++ b/fetch-pack.c @@ -1039,10 +1039,10 @@ static void update_shallow(struct fetch_pack_args *args, * after get_pack() and reprepare_packed_git()) */ struct sha1_array extra = SHA1_ARRAY_INIT; - unsigned char (*sha1)[20] = si->shallow->sha1; + struct object_id *oid = si->shallow->oid; for (i = 0; i < si->shallow->nr; i++) - if (has_sha1_file(sha1[i])) - sha1_array_append(&extra, sha1[i]); + if (has_object_file(&oid[i])) + sha1_array_append(&extra, oid[i].hash); if (extra.nr) { setup_alternate_shallow(&shallow_lock, &alternate_shallow_file, @@ -1071,16 +1071,16 @@ static void update_shallow(struct fetch_pack_args *args, * refs. */ struct sha1_array extra = SHA1_ARRAY_INIT; - unsigned char (*sha1)[20] = si->shallow->sha1; + struct object_id *oid = si->shallow->oid; assign_shallow_commits_to_refs(si, NULL, NULL); if (!si->nr_ours && !si->nr_theirs) { sha1_array_clear(&ref); return; } for (i = 0; i < si->nr_ours; i++) - sha1_array_append(&extra, sha1[si->ours[i]]); + sha1_array_append(&extra, oid[si->ours[i]].hash); for (i = 0; i < si->nr_theirs; i++) - sha1_array_append(&extra, sha1[si->theirs[i]]); + sha1_array_append(&extra, oid[si->theirs[i]].hash); setup_alternate_shallow(&shallow_lock, &alternate_shallow_file, &extra); |