summaryrefslogtreecommitdiff
path: root/http-push.c
diff options
context:
space:
mode:
authorbrian m. carlson <sandals@crustytoothpaste.net>2015-11-10 02:22:28 +0000
committerJeff King <peff@peff.net>2015-11-20 08:02:05 -0500
commitf2fd0760f62e79609fef7bfd7ecebb002e8e4ced (patch)
tree1f915114b015428730e95a89697783560b672008 /http-push.c
parent7999b2cf772956466baa8925491d6fb1b0963292 (diff)
downloadgit-f2fd0760f62e79609fef7bfd7ecebb002e8e4ced.tar.gz
Convert struct object to object_id
struct object is one of the major data structures dealing with object IDs. Convert it to use struct object_id instead of an unsigned char array. Convert get_object_hash to refer to the new member as well. Signed-off-by: brian m. carlson <sandals@crustytoothpaste.net> Signed-off-by: Jeff King <peff@peff.net>
Diffstat (limited to 'http-push.c')
-rw-r--r--http-push.c22
1 files changed, 11 insertions, 11 deletions
diff --git a/http-push.c b/http-push.c
index 45ff2c4ab1..76268edecb 100644
--- a/http-push.c
+++ b/http-push.c
@@ -275,7 +275,7 @@ static void start_fetch_loose(struct transfer_request *request)
static void start_mkcol(struct transfer_request *request)
{
- char *hex = sha1_to_hex(request->obj->sha1);
+ char *hex = oid_to_hex(&request->obj->oid);
struct active_request_slot *slot;
request->url = get_remote_object_url(repo->url, hex, 1);
@@ -306,14 +306,14 @@ static void start_fetch_packed(struct transfer_request *request)
target = find_sha1_pack(get_object_hash(*request->obj), repo->packs);
if (!target) {
- fprintf(stderr, "Unable to fetch %s, will not be able to update server info refs\n", sha1_to_hex(request->obj->sha1));
+ fprintf(stderr, "Unable to fetch %s, will not be able to update server info refs\n", oid_to_hex(&request->obj->oid));
repo->can_update_info_refs = 0;
release_request(request);
return;
}
fprintf(stderr, "Fetching pack %s\n", sha1_to_hex(target->sha1));
- fprintf(stderr, " which contains %s\n", sha1_to_hex(request->obj->sha1));
+ fprintf(stderr, " which contains %s\n", oid_to_hex(&request->obj->oid));
preq = new_http_pack_request(target, repo->url);
if (preq == NULL) {
@@ -350,7 +350,7 @@ static void start_fetch_packed(struct transfer_request *request)
static void start_put(struct transfer_request *request)
{
- char *hex = sha1_to_hex(request->obj->sha1);
+ char *hex = oid_to_hex(&request->obj->oid);
struct active_request_slot *slot;
struct strbuf buf = STRBUF_INIT;
enum object_type type;
@@ -537,7 +537,7 @@ static void finish_request(struct transfer_request *request)
start_put(request);
} else {
fprintf(stderr, "MKCOL %s failed, aborting (%d/%ld)\n",
- sha1_to_hex(request->obj->sha1),
+ oid_to_hex(&request->obj->oid),
request->curl_result, request->http_code);
request->state = ABORTED;
aborted = 1;
@@ -547,7 +547,7 @@ static void finish_request(struct transfer_request *request)
start_move(request);
} else {
fprintf(stderr, "PUT %s failed, aborting (%d/%ld)\n",
- sha1_to_hex(request->obj->sha1),
+ oid_to_hex(&request->obj->oid),
request->curl_result, request->http_code);
request->state = ABORTED;
aborted = 1;
@@ -556,12 +556,12 @@ static void finish_request(struct transfer_request *request)
if (request->curl_result == CURLE_OK) {
if (push_verbosely)
fprintf(stderr, " sent %s\n",
- sha1_to_hex(request->obj->sha1));
+ oid_to_hex(&request->obj->oid));
request->obj->flags |= REMOTE;
release_request(request);
} else {
fprintf(stderr, "MOVE %s failed, aborting (%d/%ld)\n",
- sha1_to_hex(request->obj->sha1),
+ oid_to_hex(&request->obj->oid),
request->curl_result, request->http_code);
request->state = ABORTED;
aborted = 1;
@@ -1307,7 +1307,7 @@ static struct object_list **process_tree(struct tree *tree,
if (obj->flags & (UNINTERESTING | SEEN))
return p;
if (parse_tree(tree) < 0)
- die("bad tree object %s", sha1_to_hex(obj->sha1));
+ die("bad tree object %s", oid_to_hex(&obj->oid));
obj->flags |= SEEN;
name = xstrdup(name);
@@ -1369,7 +1369,7 @@ static int get_delta(struct rev_info *revs, struct remote_lock *lock)
p = process_blob((struct blob *)obj, p, NULL, name);
continue;
}
- die("unknown pending object %s (%s)", sha1_to_hex(obj->sha1), name);
+ die("unknown pending object %s (%s)", oid_to_hex(&obj->oid), name);
}
while (objects) {
@@ -1490,7 +1490,7 @@ static void add_remote_info_ref(struct remote_ls_ctx *ls)
o = deref_tag(o, ls->dentry_name, 0);
if (o)
strbuf_addf(buf, "%s\t%s^{}\n",
- sha1_to_hex(o->sha1), ls->dentry_name);
+ oid_to_hex(&o->oid), ls->dentry_name);
}
free(ref);
}