summaryrefslogtreecommitdiff
path: root/http-push.c
diff options
context:
space:
mode:
authorbrian m. carlson <sandals@crustytoothpaste.net>2019-02-19 00:05:11 (GMT)
committerJunio C Hamano <gitster@pobox.com>2019-04-01 02:57:38 (GMT)
commit1cb158b6e65fbfd12099dc0d39642ad146dd887f (patch)
tree50cd8c4cf6d4ca2d4e3670c71c1f1e84a66c2fb8 /http-push.c
parentf786ae9ff91e356960521b3a0db95c5a66b59809 (diff)
downloadgit-1cb158b6e65fbfd12099dc0d39642ad146dd887f.zip
git-1cb158b6e65fbfd12099dc0d39642ad146dd887f.tar.gz
git-1cb158b6e65fbfd12099dc0d39642ad146dd887f.tar.bz2
http-push: remove remaining uses of sha1_to_hex
Since sha1_to_hex is limited to SHA-1, switch all remaining uses of it in this file to hash_to_hex or oid_to_hex. Modify update_remote to take a pointer to struct object_id, and since we don't modify that parameter in the function, set it to be const as well. Signed-off-by: brian m. carlson <sandals@crustytoothpaste.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'http-push.c')
-rw-r--r--http-push.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/http-push.c b/http-push.c
index c4e5142..f675a96 100644
--- a/http-push.c
+++ b/http-push.c
@@ -316,7 +316,7 @@ static void start_fetch_packed(struct transfer_request *request)
}
fprintf(stderr, "Fetching pack %s\n",
- sha1_to_hex(target->hash));
+ hash_to_hex(target->hash));
fprintf(stderr, " which contains %s\n", oid_to_hex(&request->obj->oid));
preq = new_http_pack_request(target, repo->url);
@@ -1374,7 +1374,7 @@ static int get_delta(struct rev_info *revs, struct remote_lock *lock)
return count;
}
-static int update_remote(unsigned char *sha1, struct remote_lock *lock)
+static int update_remote(const struct object_id *oid, struct remote_lock *lock)
{
struct active_request_slot *slot;
struct slot_results results;
@@ -1383,7 +1383,7 @@ static int update_remote(unsigned char *sha1, struct remote_lock *lock)
dav_headers = get_dav_token_headers(lock, DAV_HEADER_IF);
- strbuf_addf(&out_buffer.buf, "%s\n", sha1_to_hex(sha1));
+ strbuf_addf(&out_buffer.buf, "%s\n", oid_to_hex(oid));
slot = get_active_slot();
slot->results = &results;
@@ -1948,7 +1948,7 @@ int cmd_main(int argc, const char **argv)
run_request_queue();
/* Update the remote branch if all went well */
- if (aborted || !update_remote(ref->new_oid.hash, ref_lock))
+ if (aborted || !update_remote(&ref->new_oid, ref_lock))
rc = 1;
if (!rc)