]> git.ipfire.org Git - thirdparty/git.git/blobdiff - remote-curl.c
Convert struct ref to use object_id.
[thirdparty/git.git] / remote-curl.c
index cc7a8a66faa96ba9bc8ae82e72d0202c0a802ba1..bc3af79e4a4605bdc6348f53225d98c524f9536e 100644 (file)
@@ -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;