diff options
author | Junio C Hamano <gitster@pobox.com> | 2015-12-10 12:36:13 -0800 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2015-12-10 12:36:13 -0800 |
commit | 844a9ce47208de173341525c15a4c8c689dd278e (patch) | |
tree | d771915b28609179ddf1f3f911bcb30b7019d7cf /fetch-pack.c | |
parent | b12a966eff3f66337f83c117dbab8fa0cca16e4b (diff) | |
parent | fcd30b138759a2ab5ecb55758c3341f0d608df2b (diff) | |
download | git-844a9ce47208de173341525c15a4c8c689dd278e.tar.gz git-844a9ce47208de173341525c15a4c8c689dd278e.tar.xz |
Merge branch 'bc/object-id'
More transition from "unsigned char[40]" to "struct object_id".
This needed a few merge fixups, but is mostly disentangled from other
topics.
* bc/object-id:
remote: convert functions to struct object_id
Remove get_object_hash.
Convert struct object to object_id
Add several uses of get_object_hash.
object: introduce get_object_hash macro.
ref_newer: convert to use struct object_id
push_refs_with_export: convert to struct object_id
get_remote_heads: convert to struct object_id
parse_fetch: convert to use struct object_id
add_sought_entry_mem: convert to struct object_id
Convert struct ref to use object_id.
sha1_file: introduce has_object_file helper.
Diffstat (limited to 'fetch-pack.c')
-rw-r--r-- | fetch-pack.c | 24 |
1 files changed, 12 insertions, 12 deletions
diff --git a/fetch-pack.c b/fetch-pack.c index 2dabee97b..01e34b689 100644 --- a/fetch-pack.c +++ b/fetch-pack.c @@ -169,7 +169,7 @@ static const unsigned char *get_rev(void) } } - return commit->object.sha1; + return commit->object.oid.hash; } enum ack_type { @@ -238,7 +238,7 @@ static void send_request(struct fetch_pack_args *args, static void insert_one_alternate_ref(const struct ref *ref, void *unused) { - rev_list_insert_ref(NULL, ref->old_sha1); + rev_list_insert_ref(NULL, ref->old_oid.hash); } #define INITIAL_FLUSH 16 @@ -280,7 +280,7 @@ static int find_common(struct fetch_pack_args *args, fetching = 0; for ( ; refs ; refs = refs->next) { - unsigned char *remote = refs->old_sha1; + unsigned char *remote = refs->old_oid.hash; const char *remote_hex; struct object *o; @@ -487,7 +487,7 @@ static int mark_complete(const unsigned char *sha1) if (!t->tagged) break; /* broken repository */ o->flags |= COMPLETE; - o = parse_object(t->tagged->sha1); + o = parse_object(t->tagged->oid.hash); } if (o && o->type == OBJ_COMMIT) { struct commit *commit = (struct commit *)o; @@ -511,7 +511,7 @@ static void mark_recent_complete_commits(struct fetch_pack_args *args, while (complete && cutoff <= complete->item->date) { if (args->verbose) fprintf(stderr, "Marking %s as complete\n", - sha1_to_hex(complete->item->object.sha1)); + oid_to_hex(&complete->item->object.oid)); pop_most_recent_commit(&complete, COMPLETE); } } @@ -570,7 +570,7 @@ static void filter_refs(struct fetch_pack_args *args, continue; if (get_sha1_hex(ref->name, sha1) || ref->name[40] != '\0' || - hashcmp(sha1, ref->old_sha1)) + hashcmp(sha1, ref->old_oid.hash)) continue; ref->matched = 1; @@ -583,7 +583,7 @@ static void filter_refs(struct fetch_pack_args *args, static void mark_alternate_complete(const struct ref *ref, void *unused) { - mark_complete(ref->old_sha1); + mark_complete(ref->old_oid.hash); } static int everything_local(struct fetch_pack_args *args, @@ -599,10 +599,10 @@ static int everything_local(struct fetch_pack_args *args, for (ref = *refs; ref; ref = ref->next) { struct object *o; - if (!has_sha1_file(ref->old_sha1)) + if (!has_object_file(&ref->old_oid)) continue; - o = parse_object(ref->old_sha1); + o = parse_object(ref->old_oid.hash); if (!o) continue; @@ -630,7 +630,7 @@ static int everything_local(struct fetch_pack_args *args, * Don't mark them common yet; the server has to be told so first. */ for (ref = *refs; ref; ref = ref->next) { - struct object *o = deref_tag(lookup_object(ref->old_sha1), + struct object *o = deref_tag(lookup_object(ref->old_oid.hash), NULL, 0); if (!o || o->type != OBJ_COMMIT || !(o->flags & COMPLETE)) @@ -646,7 +646,7 @@ static int everything_local(struct fetch_pack_args *args, filter_refs(args, refs, sought, nr_sought); for (retval = 1, ref = *refs; ref ; ref = ref->next) { - const unsigned char *remote = ref->old_sha1; + const unsigned char *remote = ref->old_oid.hash; struct object *o; o = lookup_object(remote); @@ -985,7 +985,7 @@ static void update_shallow(struct fetch_pack_args *args, if (!si->nr_ours && !si->nr_theirs) return; for (i = 0; i < nr_sought; i++) - sha1_array_append(&ref, sought[i]->old_sha1); + sha1_array_append(&ref, sought[i]->old_oid.hash); si->ref = &ref; if (args->update_shallow) { |