From patchwork Tue Feb 12 01:22:43 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "brian m. carlson" X-Patchwork-Id: 10807147 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 9073213A4 for ; Tue, 12 Feb 2019 01:23:39 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 80E992AC25 for ; Tue, 12 Feb 2019 01:23:39 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 75AD82AC31; Tue, 12 Feb 2019 01:23:39 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-8.0 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,MAILING_LIST_MULTI,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 222102AC25 for ; Tue, 12 Feb 2019 01:23:39 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727215AbfBLBXh (ORCPT ); Mon, 11 Feb 2019 20:23:37 -0500 Received: from injection.crustytoothpaste.net ([192.241.140.119]:34322 "EHLO injection.crustytoothpaste.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727137AbfBLBXf (ORCPT ); Mon, 11 Feb 2019 20:23:35 -0500 Received: from genre.crustytoothpaste.net (unknown [IPv6:2001:470:b978:101:3dc7:72ec:75fa:fee5]) (using TLSv1.2 with cipher ECDHE-RSA-CHACHA20-POLY1305 (256/256 bits)) (No client certificate requested) by injection.crustytoothpaste.net (Postfix) with ESMTPSA id A74AC60899; Tue, 12 Feb 2019 01:23:32 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=crustytoothpaste.net; s=default; t=1549934613; bh=u4Oz/WO5+HhIy4BmxYdkaenf1TjVyDZL9RnBd377Dvw=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From:Reply-To: Subject:Date:To:CC:Resent-Date:Resent-From:Resent-To:Resent-Cc: In-Reply-To:References:Content-Type:Content-Disposition; b=Pcng5MEFTaZ7rcXILUoxAW2ONMNVeN6GqWEayfdpTdFJD/A1+FPe+sEiEBpa7ezGh 53eE6yBZTgL77rpBtJD1oTE+fA/5TSvZ6nodFegIaSmu9O7gtkxXEEqYqGEY+fp1IB lslPjqm16ttUGtlIf+muQLgCp1uE5BWSKtg0rENIfUOt3sLpRTToha1ji/OVzCjYFE ia2sryZR7ktnA4EfHoR/kWulZe8sphoKhn5qj0xRVu+dMyTzoFGzGohG36/d/vX/nj saim8U/In7rY/YshF9Ig7viwvVXGDAx4QLLYz1c1GtP7BTcdejRfUt1DQgI2BvczOz r/Sq1nvto3jWpZa0/TPzxmdCROaSWC7gqwEzBCCzSJ6Q4GgKrClDkTYSa72uTiuNGC E9TdLfdIUs6kNUXXZLWrkC2BL1Hv5dMe1PZacTQGy41hMKOpI9Rm6+xC/9Ay98trDQ D4QQ85L+yEuAi27vSJ4qZ9jLKIhmdFtOalvgSbsX7vi2SeMlOr0 From: "brian m. carlson" To: Cc: =?utf-8?q?Ren=C3=A9_Scharfe?= , Duy Nguyen Subject: [PATCH 18/31] http-push: remove remaining uses of sha1_to_hex Date: Tue, 12 Feb 2019 01:22:43 +0000 Message-Id: <20190212012256.1005924-19-sandals@crustytoothpaste.net> X-Mailer: git-send-email 2.20.1.791.gb4d0f1c61a In-Reply-To: <20190212012256.1005924-1-sandals@crustytoothpaste.net> References: <20190212012256.1005924-1-sandals@crustytoothpaste.net> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 127.0.1.1 Sender: git-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: git@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP 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 --- http-push.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/http-push.c b/http-push.c index c4e5142bc9..f675a96316 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)