From patchwork Thu Sep 13 05:17:32 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: 10598693 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 23D9214E5 for ; Thu, 13 Sep 2018 05:18:14 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 1290D2A488 for ; Thu, 13 Sep 2018 05:18:14 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 06C492A496; Thu, 13 Sep 2018 05:18:14 +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 9717A2A488 for ; Thu, 13 Sep 2018 05:18:13 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726741AbeIMKZ7 (ORCPT ); Thu, 13 Sep 2018 06:25:59 -0400 Received: from injection.crustytoothpaste.net ([192.241.140.119]:54386 "EHLO injection.crustytoothpaste.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726317AbeIMKZ7 (ORCPT ); Thu, 13 Sep 2018 06:25:59 -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 8CF7B60745; Thu, 13 Sep 2018 05:18:03 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=crustytoothpaste.net; s=default; t=1536815886; bh=x3KYa/ksG5OV9MpWWBr1lE1vw1WCpcfylSBqtjueFb8=; 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=ZEpVUJe8WhXNXfEWPAdW6rIBbZwy1p/nz5E3ecli3SYKbPtvy3cyrPX5sEDP5/R5q XXK7y1cp2DftMR5SikguqbneoLwB/8+nJnint0wdH8Hr/C1UTqOhcg5Cv6LpVU+7dq rGPu3/ckmGnepSGYyRuxZf/uqWUijNDdH39E90h2Cf16SUW4r6kPqIZlydC+ChR+mK Wk3tFnlKHr9Eozeh9vJQGCDE8bgXqLBL4ymMmXh3a8rqe1gywdv8H4pU6Gn/DuAVLL 7CxY82xtPTiIHb46UBkAIr8uA5ftgKLj9VygEveAXQtvcV2KPMkKg5AyY6pbape+kI 8ADL9ZIabJNJcZ+25gnr5BiCKlIf+GtwOXyBpqlQCqSVRBAgd0KDBMMOmFHU8ursPu GpzuiXecJuvGt6A9YTPlni5bHafRuB6DYK2Z+4VDjnTDGU9SuDS62qrWcxKcmbPfnM T5rWR9FpujJ34IxEieDun4bQl4nQKDKzE2Y/qfbmlyIgN0RU286 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 02/12] t0000: use hash translation table Date: Thu, 13 Sep 2018 05:17:32 +0000 Message-Id: <20180913051742.252276-3-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 If the hash we're using is 32 bytes in size, attempting to insert a 20-byte object name won't work. Since these are synthesized objects that are almost all zeros, look them up in a translation table. Signed-off-by: brian m. carlson --- t/t0000-basic.sh | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/t/t0000-basic.sh b/t/t0000-basic.sh index b94221b951..a9dc534048 100755 --- a/t/t0000-basic.sh +++ b/t/t0000-basic.sh @@ -1015,12 +1015,13 @@ test_expect_success SHA1 'validate object ID for a known tree' ' test_expect_success 'put invalid objects into the index' ' rm -f .git/index && - cat >badobjects <<-\EOF && - 100644 blob 1000000000000000000000000000000000000000 dir/file1 - 100644 blob 2000000000000000000000000000000000000000 dir/file2 - 100644 blob 3000000000000000000000000000000000000000 dir/file3 - 100644 blob 4000000000000000000000000000000000000000 dir/file4 - 100644 blob 5000000000000000000000000000000000000000 dir/file5 + suffix=$(echo $ZERO_OID | sed -e "s/^.//") && + cat >badobjects <<-EOF && + 100644 blob $(test_oid 001) dir/file1 + 100644 blob $(test_oid 002) dir/file2 + 100644 blob $(test_oid 003) dir/file3 + 100644 blob $(test_oid 004) dir/file4 + 100644 blob $(test_oid 005) dir/file5 EOF git update-index --index-info