From patchwork Sun Aug 18 19:16:46 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: 11099889 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 DA7511399 for ; Sun, 18 Aug 2019 19:21:11 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id CB60E28562 for ; Sun, 18 Aug 2019 19:21:11 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id BFB9E2856B; Sun, 18 Aug 2019 19:21:11 +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,LOTS_OF_MONEY,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 643E028562 for ; Sun, 18 Aug 2019 19:21:11 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727182AbfHRTVJ (ORCPT ); Sun, 18 Aug 2019 15:21:09 -0400 Received: from injection.crustytoothpaste.net ([192.241.140.119]:57880 "EHLO injection.crustytoothpaste.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727176AbfHRTVJ (ORCPT ); Sun, 18 Aug 2019 15:21:09 -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 C569A6077E; Sun, 18 Aug 2019 19:21:06 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=crustytoothpaste.net; s=default; t=1566156067; bh=OskeKmdpZ9nLckrJUu3+POVkfA4cNtRkaT2wjBCy2qI=; 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=o1RA/kDr0gTbUp/hCcDA4DYByDoz8lHGSSTexSDifRIT4gdq7aQj8taDGPNtfZOYB Tgot9nwYTbBc8iXJTg65LelYRYQe6b1X9otQcC+j+jE6cfCW129QW6Z3Uvq38JMOFA rxc6TJbN5bQcKbX4nrpA6Jfl09n69xoIwvR1f58paxPvk/8ET/ruaqNxWRUmFw/5lI aL3j6fAtvUvOc4/Q+tHvaW+10uUAXl8oMfZ6QAQ5fN/9yJEw9JhlMTaDV+U+3joX4N 6+ZHjcMw9aiAJzK/dDzfTTxEiiUTgbz/m5uYjsCCzVMq8Y0WxfyvEgCSvgDddB1aK4 HrQa+BrVhPWy8WvjP5jG6lEAKa2fRGXiyXH3+lTKqOQIyysIAiXnDQxBwCKfULxJO+ UOYbBseNGQbGePUkL3Ak9FQhFSQBnP4yFokAmt5H4YPJkWQiqlwRrXXVvyXadw7Dy8 7ARjeS5m0jKWp5xStGeju6+FdDTS+mj4x1UpsVOGaqtPfghWdSn From: "brian m. carlson" To: Cc: Jeff King , Taylor Blau , Thomas Gummerer , Johannes Schindelin Subject: [PATCH 14/14] t4009: make hash size independent Date: Sun, 18 Aug 2019 19:16:46 +0000 Message-Id: <20190818191646.868106-15-sandals@crustytoothpaste.net> X-Mailer: git-send-email 2.23.0.rc1.170.gbd704faa3e In-Reply-To: <20190818191646.868106-1-sandals@crustytoothpaste.net> References: <20190818191646.868106-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 Instead of hard-coding object IDs, compute them and use those in the comparison. Note that the comparison code ignores the actual object IDs, but does check that they're the right size, so computing them is the easiest way to ensure that they are. Signed-off-by: brian m. carlson --- t/t4009-diff-rename-4.sh | 19 +++++++++++-------- 1 file changed, 11 insertions(+), 8 deletions(-) diff --git a/t/t4009-diff-rename-4.sh b/t/t4009-diff-rename-4.sh index 3641fd84d6..b63bdf031f 100755 --- a/t/t4009-diff-rename-4.sh +++ b/t/t4009-diff-rename-4.sh @@ -14,6 +14,7 @@ test_expect_success \ 'cat "$TEST_DIRECTORY"/diff-lib/COPYING >COPYING && echo frotz >rezrov && git update-index --add COPYING rezrov && + orig=$(git hash-object COPYING) && tree=$(git write-tree) && echo $tree' @@ -22,6 +23,8 @@ test_expect_success \ 'sed -e 's/HOWEVER/However/' COPYING.1 && sed -e 's/GPL/G.P.L/g' COPYING.2 && rm -f COPYING && + c1=$(git hash-object COPYING.1) && + c2=$(git hash-object COPYING.2) && git update-index --add --remove COPYING COPYING.?' # tree has COPYING and rezrov. work tree has COPYING.1 and COPYING.2, @@ -31,11 +34,11 @@ test_expect_success \ git diff-index -z -C $tree >current -cat >expected <<\EOF -:100644 100644 6ff87c4664981e4397625791c8ea3bbb5f2279a3 0603b3238a076dc6c8022aedc6648fa523a17178 C1234 +cat >expected <current -cat >expected <<\EOF -:100644 100644 6ff87c4664981e4397625791c8ea3bbb5f2279a3 06c67961bbaed34a127f76d261f4c0bf73eda471 M +cat >expected <current -cat >expected <<\EOF -:100644 100644 6ff87c4664981e4397625791c8ea3bbb5f2279a3 0603b3238a076dc6c8022aedc6648fa523a17178 C1234 +cat >expected <