Message ID | 20190219000526.476553-10-sandals@crustytoothpaste.net (mailing list archive) |
---|---|
State | New, archived |
Headers | show
Return-Path: <git-owner@kernel.org> 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 0C2EB13BF for <patchwork-git@patchwork.kernel.org>; Tue, 19 Feb 2019 00:05:55 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id ED91B2B65C for <patchwork-git@patchwork.kernel.org>; Tue, 19 Feb 2019 00:05:54 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id E21FE2B65F; Tue, 19 Feb 2019 00:05:54 +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 75F2F2B65C for <patchwork-git@patchwork.kernel.org>; Tue, 19 Feb 2019 00:05:54 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1732198AbfBSAFw (ORCPT <rfc822;patchwork-git@patchwork.kernel.org>); Mon, 18 Feb 2019 19:05:52 -0500 Received: from injection.crustytoothpaste.net ([192.241.140.119]:34626 "EHLO injection.crustytoothpaste.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1732178AbfBSAFt (ORCPT <rfc822;git@vger.kernel.org>); Mon, 18 Feb 2019 19:05:49 -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 878E8603C6; Tue, 19 Feb 2019 00:05:46 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=crustytoothpaste.net; s=default; t=1550534747; bh=HMx0XwcuzIG10NLQ1Reh03cO6a4KnQFfr4gzx9GgN9g=; 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=S/MQuH4XeggU3eT71HskjjGNCl7zCTxqNYEHvDU71JnAaqPT/FZIxZV6fIOwwQOh0 tBXZWiTdV2/hNp3Fa4cEvk2umaH6SWodJGYk4zbq9G/T7Cv+OiMOJsQSnf51I5Vuz8 okdwv9o3SGjqFB6DE5VsZ8Bco9HfLvNdFcYvZbq40BpeHNI+JTlWWMtIG/Sb6JdooY cBK1U5QOq+pR5lqWWZzlM/KprnNdXW5hgMfjuEyv0NiMliUqwvW04b2zojGW8/TCGi +bbdPpHVDXEJchK/CzyaQ9VWPy2LOoGUB8ZTopvKz2pNI+yOYRG+2RVVgC+6OWv49F STEtwsjVO1ODTLClbPYoeTAVCjw9a0C4BflTbUdjqEUe2Y/Tsu6IFnlFA6UpjuWrd7 dSMTmuTOAw0FbZTbLm0ReJ8YggStWdapH9lv6eg3YUMHwvnOnuYWHTg9guNGhoekpD qodFbmGHeaKDTH4eCymxjDzBOOLnaqirvymzXi1eRSAn8gIAdaO From: "brian m. carlson" <sandals@crustytoothpaste.net> To: <git@vger.kernel.org> Cc: Eric Sunshine <sunshine@sunshineco.com>, =?utf-8?b?w4Z2YXIgQXJuZmrDtnI=?= =?utf-8?b?w7AgQmphcm1hc29u?= <avarab@gmail.com>, =?utf-8?q?Ren=C3=A9_Schar?= =?utf-8?q?fe?= <l.s.r@web.de>, Jeff King <peff@peff.net> Subject: [PATCH v2 09/35] notes-merge: switch to use the_hash_algo Date: Tue, 19 Feb 2019 00:05:00 +0000 Message-Id: <20190219000526.476553-10-sandals@crustytoothpaste.net> X-Mailer: git-send-email 2.21.0.rc0.258.g878e2cd30e In-Reply-To: <20190219000526.476553-1-sandals@crustytoothpaste.net> References: <20190219000526.476553-1-sandals@crustytoothpaste.net> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Scanned-By: MIMEDefang 2.79 on 127.0.1.1 Sender: git-owner@vger.kernel.org Precedence: bulk List-ID: <git.vger.kernel.org> X-Mailing-List: git@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP |
Series |
Hash function transition part 16
|
expand
|
diff --git a/notes-merge.c b/notes-merge.c index 280aa8e6c1..2fe724f1cf 100644 --- a/notes-merge.c +++ b/notes-merge.c @@ -29,14 +29,14 @@ void init_notes_merge_options(struct repository *r, static int path_to_oid(const char *path, struct object_id *oid) { - char hex_oid[GIT_SHA1_HEXSZ]; + char hex_oid[GIT_MAX_HEXSZ]; int i = 0; - while (*path && i < GIT_SHA1_HEXSZ) { + while (*path && i < the_hash_algo->hexsz) { if (*path != '/') hex_oid[i++] = *path; path++; } - if (*path || i != GIT_SHA1_HEXSZ) + if (*path || i != the_hash_algo->hexsz) return -1; return get_oid_hex(hex_oid, oid); }
Switch from using GIT_SHA1_HEXSZ to GIT_MAX_HEXSZ and the_hash_algo so that the code works with any hash algorithm. Signed-off-by: brian m. carlson <sandals@crustytoothpaste.net> --- notes-merge.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-)