]> git.ipfire.org Git - thirdparty/git.git/blobdiff - http-backend.c
http-backend: rewrite to take an object_id argument
[thirdparty/git.git] / http-backend.c
index b6c0484fb24de853ac205233e4e07d2e4e94ed75..a2d388de96cf727262aa455f719761780e098728 100644 (file)
@@ -350,16 +350,16 @@ static void run_service(const char **argv)
                exit(1);
 }
 
-static int show_text_ref(const char *name, const unsigned char *sha1,
-       int flag, void *cb_data)
+static int show_text_ref(const char *name, const struct object_id *oid,
+                        int flag, void *cb_data)
 {
        const char *name_nons = strip_namespace(name);
        struct strbuf *buf = cb_data;
-       struct object *o = parse_object(sha1);
+       struct object *o = parse_object(oid->hash);
        if (!o)
                return 0;
 
-       strbuf_addf(buf, "%s\t%s\n", sha1_to_hex(sha1), name_nons);
+       strbuf_addf(buf, "%s\t%s\n", oid_to_hex(oid), name_nons);
        if (o->type == OBJ_TAG) {
                o = deref_tag(o, name, 0);
                if (!o)
@@ -402,8 +402,8 @@ static void get_info_refs(char *arg)
        strbuf_release(&buf);
 }
 
-static int show_head_ref(const char *refname, const unsigned char *sha1,
-       int flag, void *cb_data)
+static int show_head_ref(const char *refname, const struct object_id *oid,
+                        int flag, void *cb_data)
 {
        struct strbuf *buf = cb_data;
 
@@ -416,7 +416,7 @@ static int show_head_ref(const char *refname, const unsigned char *sha1,
 
                strbuf_addf(buf, "ref: %s\n", target_nons);
        } else {
-               strbuf_addf(buf, "%s\n", sha1_to_hex(sha1));
+               strbuf_addf(buf, "%s\n", oid_to_hex(oid));
        }
 
        return 0;