From patchwork Sun Aug 18 20:04:16 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: 11099935 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 472891399 for ; Sun, 18 Aug 2019 20:05:55 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 39E4D27C2D for ; Sun, 18 Aug 2019 20:05:55 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 2E747284DB; Sun, 18 Aug 2019 20:05:55 +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 D7D4F27C2D for ; Sun, 18 Aug 2019 20:05:54 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727241AbfHRUFs (ORCPT ); Sun, 18 Aug 2019 16:05:48 -0400 Received: from injection.crustytoothpaste.net ([192.241.140.119]:57996 "EHLO injection.crustytoothpaste.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727227AbfHRUFq (ORCPT ); Sun, 18 Aug 2019 16:05:46 -0400 Received: from genre.crustytoothpaste.net (unknown [IPv6:2001:470:b978:101:81dd:eb9b:e758:604b]) (using TLSv1.2 with cipher ECDHE-RSA-CHACHA20-POLY1305 (256/256 bits)) (No client certificate requested) by injection.crustytoothpaste.net (Postfix) with ESMTPSA id 75F8C6074A; Sun, 18 Aug 2019 20:05:43 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=crustytoothpaste.net; s=default; t=1566158743; bh=l7uC48UD66dNlxlonpDIl1kNQ6Al5j6b0M03WG4/En4=; 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=Zn4cflYI944pksAFiLQeLMokxNPTUWSoSAwIiPWfsiIm2igAngTQ90iMlxbqfbpSi 8EBqNxslc+171XvJUsfq5XnrsbvS9+IXnB58OBDLBTuaTAglUbw/2kkeF/IDfg7c+q K/OF5PIHwZl7qlX3hNB03DJOiketscfpesEPBZGnSm+Al0w3prDv9qXHDYW2J0dR5h kjjXOKrso4/ZkyLc7gvV7v6EfKqNeaMnbe+fw4gj8aGJDh8+sLIUdlQc6eHXbP0ToP tXQluQ1YysVbdqAfc6MbBYyIgzCmd8vtIPlEhCN8aoB7gbqPMwHJLzJs880wxfOBhS zWbIjfw14kOPYokUwA7H1ii++vhNsTmxKtY2oBA+rQnv+fZpb58Rj+ZTH1GLnA4H0I 9Dk2bu3TpJDA2ZtK7Vh4+dOQ0+wz/DE9XnoImtS7wwJN64xNVDuRdJNQkvZ9W4BuvR L1yJrEXtQrxFSZ8TDj8ANtWEcr3RY+kWXv/svzUZmiu2QKIbi96 From: "brian m. carlson" To: Cc: Taylor Blau , Derrick Stolee Subject: [PATCH 15/26] sequencer: convert to use the_hash_algo Date: Sun, 18 Aug 2019 20:04:16 +0000 Message-Id: <20190818200427.870753-16-sandals@crustytoothpaste.net> X-Mailer: git-send-email 2.23.0.rc1.170.gbd704faa3e In-Reply-To: <20190818200427.870753-1-sandals@crustytoothpaste.net> References: <20190818200427.870753-1-sandals@crustytoothpaste.net> MIME-Version: 1.0 Sender: git-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: git@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Convert several uses of GIT_SHA1_HEXSZ constants to be references to the_hash_algo. Signed-off-by: brian m. carlson --- sequencer.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/sequencer.c b/sequencer.c index 34ebf8ed94..4d25e79137 100644 --- a/sequencer.c +++ b/sequencer.c @@ -3568,7 +3568,7 @@ static int do_merge(struct repository *r, goto leave_merge; } - write_message(oid_to_hex(&merge_commit->object.oid), GIT_SHA1_HEXSZ, + write_message(oid_to_hex(&merge_commit->object.oid), the_hash_algo->hexsz, git_path_merge_head(r), 0); write_message("no-ff", 5, git_path_merge_mode(r), 0); @@ -4487,7 +4487,7 @@ static const char *label_oid(struct object_id *oid, const char *label, char *p; strbuf_reset(&state->buf); - strbuf_grow(&state->buf, GIT_SHA1_HEXSZ); + strbuf_grow(&state->buf, GIT_MAX_HEXSZ); label = p = state->buf.buf; find_unique_abbrev_r(p, oid, default_abbrev); @@ -4500,7 +4500,7 @@ static const char *label_oid(struct object_id *oid, const char *label, size_t i = strlen(p) + 1; oid_to_hex_r(p, oid); - for (; i < GIT_SHA1_HEXSZ; i++) { + for (; i < the_hash_algo->hexsz; i++) { char save = p[i]; p[i] = '\0'; if (!hashmap_get_from_hash(&state->labels,