From f4e54d02b894064d370e461385b48701485672bd Mon Sep 17 00:00:00 2001 From: "brian m. carlson" Date: Tue, 10 Nov 2015 02:22:20 +0000 Subject: Convert struct ref to use object_id. Use struct object_id in three fields in struct ref and convert all the necessary places that use it. Signed-off-by: brian m. carlson Signed-off-by: Jeff King --- remote-curl.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'remote-curl.c') diff --git a/remote-curl.c b/remote-curl.c index cc7a8a66fa..bc3af79e4a 100644 --- a/remote-curl.c +++ b/remote-curl.c @@ -169,7 +169,7 @@ static struct ref *parse_info_refs(struct discovery *heads) data[i] = 0; ref_name = mid + 1; ref = alloc_ref(ref_name); - get_sha1_hex(start, ref->old_sha1); + get_oid_hex(start, &ref->old_oid); if (!refs) refs = ref; if (last_ref) @@ -348,7 +348,7 @@ static void output_refs(struct ref *refs) if (posn->symref) printf("@%s %s\n", posn->symref, posn->name); else - printf("%s %s\n", sha1_to_hex(posn->old_sha1), posn->name); + printf("%s %s\n", oid_to_hex(&posn->old_oid), posn->name); } printf("\n"); fflush(stdout); @@ -702,7 +702,7 @@ static int fetch_dumb(int nr_heads, struct ref **to_fetch) if (options.depth) die("dumb http transport does not support --depth"); for (i = 0; i < nr_heads; i++) - targets[i] = xstrdup(sha1_to_hex(to_fetch[i]->old_sha1)); + targets[i] = xstrdup(oid_to_hex(&to_fetch[i]->old_oid)); walker = get_http_walker(url.buf); walker->get_all = 1; @@ -763,7 +763,7 @@ static int fetch_git(struct discovery *heads, if (!*ref->name) die("cannot fetch by sha1 over smart http"); packet_buf_write(&preamble, "%s %s\n", - sha1_to_hex(ref->old_sha1), ref->name); + oid_to_hex(&ref->old_oid), ref->name); } packet_buf_flush(&preamble); @@ -815,7 +815,7 @@ static void parse_fetch(struct strbuf *buf) die("protocol error: expected sha/ref, got %s'", p); ref = alloc_ref(name); - hashcpy(ref->old_sha1, old_sha1); + hashcpy(ref->old_oid.hash, old_sha1); *list = ref; list = &ref->next; -- cgit v1.2.3