contrib/completion: add smerge to the mergetool completion candidates
[gitweb.git] / http.c
diff --git a/http.c b/http.c
index 954bebf6842510ea3fb83334ffe2684ade072f05..a32ad36ddf6b813ce0e02c85e7b61b4613517a9c 100644 (file)
--- a/http.c
+++ b/http.c
@@ -2343,9 +2343,9 @@ static size_t fwrite_sha1_file(char *ptr, size_t eltsize, size_t nmemb,
 }
 
 struct http_object_request *new_http_object_request(const char *base_url,
-       unsigned char *sha1)
+                                                   const struct object_id *oid)
 {
-       char *hex = sha1_to_hex(sha1);
+       char *hex = oid_to_hex(oid);
        struct strbuf filename = STRBUF_INIT;
        struct strbuf prevfile = STRBUF_INIT;
        int prevlocal;
@@ -2356,10 +2356,10 @@ struct http_object_request *new_http_object_request(const char *base_url,
 
        freq = xcalloc(1, sizeof(*freq));
        strbuf_init(&freq->tmpfile, 0);
-       hashcpy(freq->sha1, sha1);
+       oidcpy(&freq->oid, oid);
        freq->localfile = -1;
 
-       loose_object_path(the_repository, &filename, sha1);
+       loose_object_path(the_repository, &filename, oid);
        strbuf_addf(&freq->tmpfile, "%s.temp", filename.buf);
 
        strbuf_addf(&prevfile, "%s.prev", filename.buf);
@@ -2501,16 +2501,16 @@ int finish_http_object_request(struct http_object_request *freq)
        }
 
        git_inflate_end(&freq->stream);
-       git_SHA1_Final(freq->real_sha1, &freq->c);
+       git_SHA1_Final(freq->real_oid.hash, &freq->c);
        if (freq->zret != Z_STREAM_END) {
                unlink_or_warn(freq->tmpfile.buf);
                return -1;
        }
-       if (!hasheq(freq->sha1, freq->real_sha1)) {
+       if (!oideq(&freq->oid, &freq->real_oid)) {
                unlink_or_warn(freq->tmpfile.buf);
                return -1;
        }
-       loose_object_path(the_repository, &filename, freq->sha1);
+       loose_object_path(the_repository, &filename, &freq->oid);
        freq->rename = finalize_object_file(freq->tmpfile.buf, filename.buf);
        strbuf_release(&filename);