From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on dcvr.yhbt.net X-Spam-Level: X-Spam-ASN: X-Spam-Status: No, score=-3.8 required=3.0 tests=AWL,BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,RCVD_IN_DNSWL_HI, SPF_HELO_NONE,SPF_PASS shortcircuit=no autolearn=ham autolearn_force=no version=3.4.6 Received: from out1.vger.email (out1.vger.email [IPv6:2620:137:e000::1:20]) by dcvr.yhbt.net (Postfix) with ESMTP id 2BB3D1F565 for ; Wed, 27 Sep 2023 19:57:04 +0000 (UTC) Authentication-Results: dcvr.yhbt.net; dkim=pass (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20230601 header.b=cE1v/nPY; dkim-atps=neutral Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229837AbjI0T5C (ORCPT ); Wed, 27 Sep 2023 15:57:02 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:35950 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229840AbjI0T4f (ORCPT ); Wed, 27 Sep 2023 15:56:35 -0400 Received: from mail-io1-xd2b.google.com (mail-io1-xd2b.google.com [IPv6:2607:f8b0:4864:20::d2b]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 9477BCE8 for ; Wed, 27 Sep 2023 12:56:11 -0700 (PDT) Received: by mail-io1-xd2b.google.com with SMTP id ca18e2360f4ac-79fca042ec0so242158739f.3 for ; Wed, 27 Sep 2023 12:56:11 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1695844570; x=1696449370; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=/lEoBpkJLVvzE2xIITImYwnRjfOno4E1sdAiC3yAWps=; b=cE1v/nPY1K8jW13vvqDOoQZoFpLKKmzUsLHD3bTU7a6dL9R2fCwO6FONjQ2hVCUd+1 Sv/6swfPlnxcYPG2BPAHNXTb+jSjw3hslSycL7yhwFO0AH1XJSgxBJYMurjcDFUSiD2m N+QO5bw/A2Qtp8eppkUtttgKDkh7ssM+VWV0fHZ5DOYrxvfF5h1FcLrgxmgjYLisxoFv KPmfb56vPEPbTKeu14nmM9ofjxAT3SU7VV9P/rWCPYGEkrLLXVAmL09cILWH2xeJ1Bn3 qv+Isw/FiX7wr5nHIZR77dGWvM2oMXtwNoqkvFSVIV8Idy/hoNXjxYOFOCaDqTcnVSh2 d+HQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1695844570; x=1696449370; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=/lEoBpkJLVvzE2xIITImYwnRjfOno4E1sdAiC3yAWps=; b=XjFLGWJ3td1S+UlZOCLQOF5JkU4palKlBxPiY48T3gvTRgS/TKc3M9sTt1vLP/GJEG w84kRVyThCY1V6ooUz+MRPRba/bZksEnOBPuoSW51Y8BDXoLOpcsmCRTL2tzUtVZCpG8 oIVdNjhthtxBHz9yP4iiaqby/trNL7yB+8EzVECnXOxpd9CIxfOBrJyz3BdABfRIePr8 Th87JgbHopwXM55eUC4xgSWRa6C6YwYQvhmaKB89c3Eij1kq/U5cyesrYNMPkQ0G6BjS 1BXN9Y6lzfAS4Im5XppLSH9Uo+T05qRxZHkqejvd4ctWsI6KuMEFC4c6FJWvCrYF23+2 iu3Q== X-Gm-Message-State: AOJu0YxTs7YHHqaz/Dnopczq8BFgQKoy9bKoJhy8v82+8htmIs8Gz33P 95BHhtp9e6DEG4VymV6j+B9Pe8F0/UU= X-Google-Smtp-Source: AGHT+IEsjdD5PSpTih4Njd5AFGe3RGvqOsgXr7W7u9NlHatb3CfbIhsswlak8o9bYYINYCuvO94m3w== X-Received: by 2002:a5e:870e:0:b0:792:931e:a93a with SMTP id y14-20020a5e870e000000b00792931ea93amr3239509ioj.4.1695844570558; Wed, 27 Sep 2023 12:56:10 -0700 (PDT) Received: from localhost.localdomain (ip68-227-168-167.om.om.cox.net. [68.227.168.167]) by smtp.gmail.com with ESMTPSA id o23-20020a6b5a17000000b007836c7e8dccsm2935628iob.17.2023.09.27.12.56.10 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 27 Sep 2023 12:56:10 -0700 (PDT) From: "Eric W. Biederman" To: Junio C Hamano Cc: git@vger.kernel.org, "brian m. carlson" , "Eric W. Biederman" Subject: [PATCH 27/30] test-lib: Compute the compatibility hash so tests may use it Date: Wed, 27 Sep 2023 14:55:34 -0500 Message-Id: <20230927195537.1682-27-ebiederm@gmail.com> X-Mailer: git-send-email 2.30.2 In-Reply-To: <87jzsbjt0a.fsf@gmail.froward.int.ebiederm.org> References: <87jzsbjt0a.fsf@gmail.froward.int.ebiederm.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: git@vger.kernel.org From: "Eric W. Biederman" Inspired-by: brian m. carlson Signed-off-by: "Eric W. Biederman" --- t/test-lib-functions.sh | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) diff --git a/t/test-lib-functions.sh b/t/test-lib-functions.sh index 2f8868caa171..92b462e2e711 100644 --- a/t/test-lib-functions.sh +++ b/t/test-lib-functions.sh @@ -1599,7 +1599,16 @@ test_set_hash () { # Detect the hash algorithm in use. test_detect_hash () { - test_hash_algo="${GIT_TEST_DEFAULT_HASH:-sha1}" + case "$GIT_TEST_DEFAULT_HASH" in + "sha256") + test_hash_algo=sha256 + test_compat_hash_algo=sha1 + ;; + *) + test_hash_algo=sha1 + test_compat_hash_algo=sha256 + ;; + esac } # Load common hash metadata and common placeholder object IDs for use with @@ -1651,6 +1660,12 @@ test_oid () { local algo="${test_hash_algo}" && case "$1" in + --hash=storage) + algo="$test_hash_algo" && + shift;; + --hash=compat) + algo="$test_compat_hash_algo" && + shift;; --hash=*) algo="${1#--hash=}" && shift;; -- 2.41.0