From patchwork Thu Sep 13 05:17:35 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "brian m. carlson" X-Patchwork-Id: 10598699 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 E32E2112B for ; Thu, 13 Sep 2018 05:18:20 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id D46AE2A488 for ; Thu, 13 Sep 2018 05:18:20 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id C8F7E2A496; Thu, 13 Sep 2018 05:18:20 +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 7EFED2A488 for ; Thu, 13 Sep 2018 05:18:20 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726985AbeIMK0J (ORCPT ); Thu, 13 Sep 2018 06:26:09 -0400 Received: from injection.crustytoothpaste.net ([192.241.140.119]:54422 "EHLO injection.crustytoothpaste.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726317AbeIMK0J (ORCPT ); Thu, 13 Sep 2018 06:26:09 -0400 Received: from genre.crustytoothpaste.net (108-60-118-130.static.wiline.com [108.60.118.130]) (using TLSv1.2 with cipher ECDHE-RSA-CHACHA20-POLY1305 (256/256 bits)) (No client certificate requested) by injection.crustytoothpaste.net (Postfix) with ESMTPSA id 02E5D60748; Thu, 13 Sep 2018 05:18:15 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=crustytoothpaste.net; s=default; t=1536815897; bh=r8E+oKIgjP7htHY8IvAtKJhOR+w4aDcUyxphfIhFFjk=; 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=vfZ0MyptjD+IBMondSzW1WuY0KFNqOywoJUD5XffAhnCJkOl1+X5EuTOZB7doNKnp iY2txURByu3NomLcULk4/ylw4wpbfVwhxJykRfkJG+CxWqOClq5VQv1EaAe1QP/21V IOOmbebFshESIgzkC0QzkIoCrfhnv6uDp0gsbRXnLX96PjRA+IpMKO9lR9UrsL7M7Z bB+Nmtj1Z8XGrbntcGag9/uFhkBfO6FDTs5tk+vA0zLier5I9+BndbmnHqRadFaBBo xqXtB2J2veWKw45tgu92nPGnvmBxhJe2BScnnM3VowruqwWdfTo5chIK1Q2O7MX13f RFaLPTre74g76eU9vIYWSUdQwBPeJAKZnV0RvI2VFVtgnpwkGtab/QGnj6xrdQ9XTT NLl9d7x+zApgXTM/7YosqMX3hhbUpRhkWNpg/JZnMB7ixK9kTuSNuxjNZWq1OtArQL 5vby6qE1u/zfQcs30wNXWQ9rkDSIZHWicjpg5HTMI3rMvxOoxE3 From: "brian m. carlson" To: git@vger.kernel.org Cc: Jeff King , Eric Sunshine , =?utf-8?b?Tmd1eeG7hW4gVGjDoWkgTmfhu41jIER1eQ==?= , =?utf-8?q?Torsten_B=C3=B6gershausen?= , Derrick Stolee , Junio C Hamano Subject: [PATCH v5 05/12] t0027: make hash size independent Date: Thu, 13 Sep 2018 05:17:35 +0000 Message-Id: <20180913051742.252276-6-sandals@crustytoothpaste.net> X-Mailer: git-send-email 2.19.0.397.gdd90340f6a In-Reply-To: <20180913051742.252276-1-sandals@crustytoothpaste.net> References: <20180913051742.252276-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 We transform various object IDs into all-zero object IDs for comparison. Adjust the length as well so that this works for all hash algorithms. While it would be slightly more efficient to use a sed y/// expression instead of both the tr and sed, retain the tr in both cases for parallelism and compactness. Signed-off-by: brian m. carlson --- t/t0027-auto-crlf.sh | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/t/t0027-auto-crlf.sh b/t/t0027-auto-crlf.sh index beb5927f77..dfb46bbe86 100755 --- a/t/t0027-auto-crlf.sh +++ b/t/t0027-auto-crlf.sh @@ -15,7 +15,8 @@ compare_ws_file () { pfx=$1 exp=$2.expect act=$pfx.actual.$3 - tr '\015\000abcdef0123456789' QN00000000000000000 <"$2" >"$exp" && + tr '\015\000abcdef0123456789' QN00000000000000000 <"$2" | + sed -e "s/0000*/$ZERO_OID/" >"$exp" && tr '\015\000abcdef0123456789' QN00000000000000000 <"$3" >"$act" && test_cmp "$exp" "$act" && rm "$exp" "$act"