From patchwork Tue Feb 28 23:38:54 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Junio C Hamano X-Patchwork-Id: 13155350 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 06D9EC64EC7 for ; Tue, 28 Feb 2023 23:39:17 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229652AbjB1XjR (ORCPT ); Tue, 28 Feb 2023 18:39:17 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:54226 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229509AbjB1XjQ (ORCPT ); Tue, 28 Feb 2023 18:39:16 -0500 Received: from mail-pf1-x42a.google.com (mail-pf1-x42a.google.com [IPv6:2607:f8b0:4864:20::42a]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 56F0015562 for ; Tue, 28 Feb 2023 15:39:15 -0800 (PST) Received: by mail-pf1-x42a.google.com with SMTP id c4so3958366pfl.0 for ; Tue, 28 Feb 2023 15:39:15 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:sender:from:to:cc:subject:date:message-id:reply-to; bh=AINjlT2zqt6oriW+wceOlh9rJPFO6vSmOq/RfBfwvNo=; b=kz08VHNdeGtdq6V36GR7FtEwJ03XduVLym1Gp6LZGu2ehxb3sG1RBPB9iLtmc3RHiy dM8rF0F7xO5PljNCz0lsL7Q4q2Gat3CHf0+wuyRy5oL8kAkMA28tT4iNZNgkmQxbyzl9 Cg1IV+zgi8i0R6/0j81ER81oqd1VkCTq1ir3ep9SZzKKB0QUInqqqgm8toEvNe7OMGjO nRQ1d68ITP9aHO1sDetbCCNjvaXAd4OiSHhbz8mm5nZWCYf9qt//+aPwmDzJbGUpagxD jTskNxQfPkJH5HaiEQ8epD6f70I74aK3mAI715vr7rkrnrX/OvrIdFHZDNys9OV1d4gf +mZA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:sender:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=AINjlT2zqt6oriW+wceOlh9rJPFO6vSmOq/RfBfwvNo=; b=DdwSks3YL4Ihnu9vB/dVDUPJ8Fsb6R9dHsfM2CStCzB7BBwxh/BY8kD2CtyAMbxGVM V+pkIbuj18CDv71OokcuoFjQt4VWCJHzc75YglgIMvb/wx1DCGL12nVRcGI9OggdsEqM o21ARtJlhGowZTphhXejaReMEMIjih9+4vzr9lta1rpEIN6nfVjlt0H3UMKr81/mbb7+ lNeKX4AMjGekmTLoTTt70anVsKDj6PH8R76swKZH90CT9Rm5ISTCbp/ZFPWqQqW69RV1 xeLoB6peXwAJz11SW7/oIImLID0CInbxxUX8CEVubp6n1j2kbsJ/SCmdgTd5ANPiG1Bi aI7Q== X-Gm-Message-State: AO0yUKUsOC7ZZ647lvIHPf2EBSXNaORXJ2kVE3bHcGl9OPI6E1Xs2mML fx8foMuw2ElLytsXKVlsld3XxDSEfiI= X-Google-Smtp-Source: AK7set/jflA8KJQntB52p26G2jSX235/iK6FX5gMgmSAuNGL4KYRAi1jUATLnwORxM6VeKWouwca4Q== X-Received: by 2002:aa7:9704:0:b0:592:de72:4750 with SMTP id a4-20020aa79704000000b00592de724750mr3899019pfg.23.1677627554253; Tue, 28 Feb 2023 15:39:14 -0800 (PST) Received: from localhost (252.157.168.34.bc.googleusercontent.com. [34.168.157.252]) by smtp.gmail.com with ESMTPSA id b15-20020aa7810f000000b005b6f63c6cf4sm6547110pfi.30.2023.02.28.15.39.13 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 28 Feb 2023 15:39:13 -0800 (PST) Sender: Junio C Hamano From: Junio C Hamano To: git@vger.kernel.org Cc: Jeff King Subject: [PATCH 01/20] t5541: run "used receive-pack service" test earlier Date: Tue, 28 Feb 2023 15:38:54 -0800 Message-Id: <20230228233913.684853-1-gitster@pobox.com> X-Mailer: git-send-email 2.40.0-rc0-32-ga0f05f6840 MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: git@vger.kernel.org From: Jeff King There's a test in t5541 that confirms that "git push" makes two requests (a GET to /info/refs, and a POST to /git-receive-pack). However, it's a noop unless GIT_TEST_PROTOCOL_VERSION is set to "0", due to 8a1b0978ab (test: request GIT_TEST_PROTOCOL_VERSION=0 when appropriate, 2019-12-23). This means that almost nobody runs it. And indeed, it has been broken since b0c4adcdd7 (remote-curl: send Accept-Language header to server, 2022-07-11). But the fault is not in that commit, but in how brittle the test is. It runs after several operations have been performed, which means that it expects to see the complete set of requests made so far in the script. Commit b0c4adcdd7 added a new test, which means that the "used receive-pack service" test must be updated, too. Let's fix this by making the test less brittle. We'll move it higher in the script, right after the first push has completed. And we'll clear the access log right before doing the push, so we'll see only the requests from that command. This is technically testing less, in that we won't check that all of those other requests also correctly used smart http. But there's no particular reason think that if the first one did, the others wouldn't. After this patch, running: GIT_TEST_PROTOCOL_VERSION=0 ./t5541-http-push-smart.sh passes, whereas it did not before. Signed-off-by: Jeff King Signed-off-by: Junio C Hamano --- t/t5541-http-push-smart.sh | 44 ++++++++++++++++---------------------- 1 file changed, 18 insertions(+), 26 deletions(-) diff --git a/t/t5541-http-push-smart.sh b/t/t5541-http-push-smart.sh index fbad2d5ff5..ef39d14ed2 100755 --- a/t/t5541-http-push-smart.sh +++ b/t/t5541-http-push-smart.sh @@ -41,10 +41,6 @@ GET /smart/test_repo.git/info/refs?service=git-upload-pack HTTP/1.1 200 POST /smart/test_repo.git/git-upload-pack HTTP/1.1 200 EOF test_expect_success 'no empty path components' ' - # Clear the log, so that it does not affect the "used receive-pack - # service" test which reads the log too. - test_when_finished ">\"\$HTTPD_ROOT_PATH\"/access.log" && - # In the URL, add a trailing slash, and see if git appends yet another # slash. cd "$ROOT_PATH" && @@ -67,6 +63,10 @@ test_expect_success 'clone remote repository' ' ' test_expect_success 'push to remote repository (standard)' ' + # Clear the log, so that the "used receive-pack service" test below + # sees just what we did here. + >"$HTTPD_ROOT_PATH"/access.log && + cd "$ROOT_PATH"/test_repo_clone && : >path2 && git add path2 && @@ -80,6 +80,20 @@ test_expect_success 'push to remote repository (standard)' ' test $HEAD = $(git rev-parse --verify HEAD)) ' +test_expect_success 'used receive-pack service' ' + cat >exp <<-\EOF && + GET /smart/test_repo.git/info/refs?service=git-receive-pack HTTP/1.1 200 + POST /smart/test_repo.git/git-receive-pack HTTP/1.1 200 + EOF + + # NEEDSWORK: If the overspecification of the expected result is reduced, we + # might be able to run this test in all protocol versions. + if test "$GIT_TEST_PROTOCOL_VERSION" = 0 + then + check_access_log exp + fi +' + test_expect_success 'push to remote repository (standard) with sending Accept-Language' ' cat >exp <<-\EOF && => Send header: Accept-Language: ko-KR, *;q=0.9 @@ -141,28 +155,6 @@ test_expect_success 'rejected update prints status' ' ' rm -f "$HTTPD_DOCUMENT_ROOT_PATH/test_repo.git/hooks/update" -cat >exp < X-Patchwork-Id: 13155351 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 028C0C64EC4 for ; Tue, 28 Feb 2023 23:39:19 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229698AbjB1XjS (ORCPT ); Tue, 28 Feb 2023 18:39:18 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:54244 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229625AbjB1XjR (ORCPT ); Tue, 28 Feb 2023 18:39:17 -0500 Received: from mail-pf1-x430.google.com (mail-pf1-x430.google.com [IPv6:2607:f8b0:4864:20::430]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C0AD2199CE for ; Tue, 28 Feb 2023 15:39:15 -0800 (PST) Received: by mail-pf1-x430.google.com with SMTP id b20so6860333pfo.6 for ; Tue, 28 Feb 2023 15:39:15 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:sender:from:to:cc:subject:date :message-id:reply-to; bh=GXJSsdVXthqG+kEn20I/vA3oLh2scYBLnzjKH4/03V0=; b=Rn2M7uZ7jCk0OiIG+zGcnLj7lSAm9hhjTEwVtZFpqW3IBLPpfK0jpqJHQUHVOe93G0 FonJ9xckhcBRyDhvaxe4JFaYUbfN5zYoGlj7egJ2+mXszgg21/IoBf61l1RAjGJoYKUQ FFWpR8EedrQeD8JrkmJsopx8FXFfzjlDu7IA1iIzDdXwj5/eC6BaxgTnPxzWfVg7xCRJ Ybi9xIRLYp6CBPNRAtuLEWg5yT3xafs8RNgqxhUAFO9OQPggQVUGZ/Gc7rCTwItOafKt VbFIycLjE5J5kzoivk0rfEfXImPZhHcjobfxFGrTW3iQnTgzeUepvoTAWWx/GQL0qVhe TJRQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:sender:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to; bh=GXJSsdVXthqG+kEn20I/vA3oLh2scYBLnzjKH4/03V0=; b=ryy5eIQrGwRlomMafO0UoKRWxGb4s9TvVcwT47/TNFl89sfg5w4SRACM66DKScx6TR aB5m62DVjWJYMa5C/uxrMheIUfIq1l2iC86XDBHVkKvxhvhlthurlFaS4qznjX8dimFB CtSyOr10/WzqXeS+FWMWC795PKqDnQWGrIfYZzp9wvBC6wp18aVSdwfqg/EeEwgLKkFy oKTpP8HH9IQmpuQ3Asq5kt9syGmhB2yZClDNzRSP3+R5Vf9uJD8IDWVt5A5okKBl3r9U ZuhTJous75FrcnXtiTjsgTi5oFvYVjhmmk6uMrya0ooA5jfnNmZrivnhhabKckI07F45 9K6A== X-Gm-Message-State: AO0yUKXP9RJD2x2M1GwfQJyr+X8kyKR0mxYrJBzWjsQUZ9C3VqLHJLFI pjm/lhdraB06wzIU6RhQILznPX4N6T8= X-Google-Smtp-Source: AK7set8j2y1EQk6FuEqeklGs1K6CspA5OdUue+Bs3kwsOd9R2QDjwBj5qfTVI1r+xFYC8XNPT0wxtg== X-Received: by 2002:a62:6346:0:b0:5db:c07e:9e4d with SMTP id x67-20020a626346000000b005dbc07e9e4dmr3799610pfb.6.1677627554906; Tue, 28 Feb 2023 15:39:14 -0800 (PST) Received: from localhost (252.157.168.34.bc.googleusercontent.com. [34.168.157.252]) by smtp.gmail.com with ESMTPSA id y5-20020aa78545000000b005a54a978c1bsm6579297pfn.7.2023.02.28.15.39.14 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 28 Feb 2023 15:39:14 -0800 (PST) Sender: Junio C Hamano From: Junio C Hamano To: git@vger.kernel.org Cc: Jeff King Subject: [PATCH 02/20] t5541: stop marking "used receive-pack service" test as v0 only Date: Tue, 28 Feb 2023 15:38:55 -0800 Message-Id: <20230228233913.684853-2-gitster@pobox.com> X-Mailer: git-send-email 2.40.0-rc0-32-ga0f05f6840 In-Reply-To: <20230228233913.684853-1-gitster@pobox.com> References: <20230228233913.684853-1-gitster@pobox.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: git@vger.kernel.org From: Jeff King We have a test which checks to see if a request to git-receive-pack was made. Originally, it was checking the entire set of requests made in the script so far, including clones, and thus it would break when run with the v2 protocol (since that implies an extra request for fetches). Since the previous commit, though, we are only checking the requests made by a single push. And since there is no v2 push protocol, the test now passes no matter what's in GIT_TEST_PROTOCOL_VERSION. We can just run it all the time. Signed-off-by: Jeff King Signed-off-by: Junio C Hamano --- t/t5541-http-push-smart.sh | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/t/t5541-http-push-smart.sh b/t/t5541-http-push-smart.sh index ef39d14ed2..f8bf533c33 100755 --- a/t/t5541-http-push-smart.sh +++ b/t/t5541-http-push-smart.sh @@ -86,12 +86,7 @@ test_expect_success 'used receive-pack service' ' POST /smart/test_repo.git/git-receive-pack HTTP/1.1 200 EOF - # NEEDSWORK: If the overspecification of the expected result is reduced, we - # might be able to run this test in all protocol versions. - if test "$GIT_TEST_PROTOCOL_VERSION" = 0 - then - check_access_log exp - fi + check_access_log exp ' test_expect_success 'push to remote repository (standard) with sending Accept-Language' ' From patchwork Tue Feb 28 23:38:56 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Junio C Hamano X-Patchwork-Id: 13155352 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id C7950C7EE30 for ; Tue, 28 Feb 2023 23:39:21 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229738AbjB1XjU (ORCPT ); Tue, 28 Feb 2023 18:39:20 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:54274 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229656AbjB1XjR (ORCPT ); Tue, 28 Feb 2023 18:39:17 -0500 Received: from mail-pf1-x42f.google.com (mail-pf1-x42f.google.com [IPv6:2607:f8b0:4864:20::42f]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id CEC031A4BF for ; Tue, 28 Feb 2023 15:39:16 -0800 (PST) Received: by mail-pf1-x42f.google.com with SMTP id n5so6837764pfv.11 for ; Tue, 28 Feb 2023 15:39:16 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:sender:from:to:cc:subject:date :message-id:reply-to; bh=mIM66mQfoMWy246+UTzcOvzWZnl4Uatjclm6VFhIvSY=; b=brSgDiCvuxdkTilL3FpaWOJ6r1sdD2a5SLjVSkfir3R6VcoN/5ZhA0FV4LmlJFKn/c FiNSSjGYk5pYS5qUhcAsi/23OHw87rtWM0ggNeKhVCfRfjxyp6z2bsaN9tCkz+ZfHk01 U79tDYGIxQpRmrZGR1vbH87JEKjTWFhSkUb+Gyl1ElWcVANt4gErYu6e7l9JKc+3ZQVg YhWTTKWjaS9qecWG+gUtP8LSyCX/f9NaoYX+Bq6xBe6BZVoTGY/n9+wVmnPhiP3XZYFN j1woHoV9Fng65svxmVRXu1d4jmFiy7kpDnznxYaPoeGtn12qBJp1WV3AJo0recPgB0FN pVYw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:sender:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to; bh=mIM66mQfoMWy246+UTzcOvzWZnl4Uatjclm6VFhIvSY=; b=jW9H0Fsfebxuui/gsRiF8VxushJWcTLfOCWw28Cpc7zok24eoynngrkTWftuq8BexE 54spgxaVVGQa2SUnerKLbwwev6A/4muSyaNIbLJ5/cwBBewfmN5y764H0wUHoP7DCVkB 7g3GZPAZvVBXssiIOcKUsP/vuGegTiuLvtbRUBnskxy4GPzRk98CVLFF1iDbCQbHwn5U FCaagqS4/YTCOuBfUvKZApe3jGvi90N0Q/FTzid+kdqrLdr62OdhCis4Ah6TgDE1qDsR 7Q/pXYO64sjvG02q8VWZbJzy5cIEDqLr2iWQ/ZyXO8XxnpdLe6oEjifM3Wz3XaiYVjwk UysQ== X-Gm-Message-State: AO0yUKWKkJS1LboaQBRq7yrLwO0/D/OlnYIdXqjREbb4NNTzv0zv3E4I L9a6ivix6jKm+vdh6tfCUMlD+BOrEm8= X-Google-Smtp-Source: AK7set+RZQStgbKRVBgJ4fNtdSwrbOkDfno0T6GOjTQDeHveMw3hFSCfKXmV/O0mDMod0D9SZEgExg== X-Received: by 2002:a62:79cb:0:b0:5a9:c16f:b4ea with SMTP id u194-20020a6279cb000000b005a9c16fb4eamr4874766pfc.7.1677627555996; Tue, 28 Feb 2023 15:39:15 -0800 (PST) Received: from localhost (252.157.168.34.bc.googleusercontent.com. [34.168.157.252]) by smtp.gmail.com with ESMTPSA id 17-20020aa79111000000b005e00086250asm6512547pfh.125.2023.02.28.15.39.15 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 28 Feb 2023 15:39:15 -0800 (PST) Sender: Junio C Hamano From: Junio C Hamano To: git@vger.kernel.org Cc: Jeff King Subject: [PATCH 03/20] t5541: simplify and move "no empty path components" test Date: Tue, 28 Feb 2023 15:38:56 -0800 Message-Id: <20230228233913.684853-3-gitster@pobox.com> X-Mailer: git-send-email 2.40.0-rc0-32-ga0f05f6840 In-Reply-To: <20230228233913.684853-1-gitster@pobox.com> References: <20230228233913.684853-1-gitster@pobox.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: git@vger.kernel.org From: Jeff King Commit 9ee6bcd398 (t5541-http-push: add test for URLs with trailing slash, 2010-04-08) added a test that clones a URL with a trailing slash, and confirms that we don't send a doubled slash (like "$url//info/refs") to the server. But this test makes no sense in t5541, which is about pushing. It should have been added in t5551. Let's move it there. But putting it at the end is tricky, since it checks the entire contents of the Apache access log. We could get around this by clearing the log before our test. But there's an even simpler solution: just make sure no doubled slashes appear in the log (fortunately, "http://" does not appear in the log itself). As a bonus, this also lets us drop the check for the v0 protocol (which is otherwise necessary since v2 makes multiple requests, and check_access_log insists on exactly matching the number of requests, even though we don't care about that here). Signed-off-by: Jeff King Signed-off-by: Junio C Hamano --- t/t5541-http-push-smart.sh | 18 ------------------ t/t5551-http-fetch-smart.sh | 9 +++++++++ 2 files changed, 9 insertions(+), 18 deletions(-) diff --git a/t/t5541-http-push-smart.sh b/t/t5541-http-push-smart.sh index f8bf533c33..d0211cd8be 100755 --- a/t/t5541-http-push-smart.sh +++ b/t/t5541-http-push-smart.sh @@ -36,24 +36,6 @@ test_expect_success 'setup remote repository' ' setup_askpass_helper -cat >exp <log && + ! grep "//" log +' + test_done From patchwork Tue Feb 28 23:38:57 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Junio C Hamano X-Patchwork-Id: 13155353 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 331CAC64EC4 for ; Tue, 28 Feb 2023 23:39:24 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229880AbjB1XjW (ORCPT ); Tue, 28 Feb 2023 18:39:22 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:54300 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229695AbjB1XjS (ORCPT ); Tue, 28 Feb 2023 18:39:18 -0500 Received: from mail-pg1-x533.google.com (mail-pg1-x533.google.com [IPv6:2607:f8b0:4864:20::533]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C8973199CE for ; Tue, 28 Feb 2023 15:39:17 -0800 (PST) Received: by mail-pg1-x533.google.com with SMTP id d6so6713940pgu.2 for ; Tue, 28 Feb 2023 15:39:17 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:sender:from:to:cc:subject:date :message-id:reply-to; bh=V32gHRTQe0M9ZrgiRRBu/GPgdm/6292eQEjf3fgmmsw=; b=EAueFSadMm2r5lpMiVTwQHJ4ApiUxAFUvFRgHVBDtQD7OdDHvXzwgif2aJpCTprkxF CwzYchk8SpK6dfnTGNXGgnSuzrJQYbwFcA1zW9XO9KLOUhzoZqkpjn5pWNv5veDT4y3Q z750AMCULwuG5agDJ9qiWMz6loqPE566sDmIlcAvzgyVwWTdn5MJiwPsHQLFkcZX9IEO Opd3A49lbIcYOe8rpou/4X0/V1f7Wj3S6hCMaTEp3MQ8zYo/dT3Zv3bC7wg3cnRAceJO tCfm2S1m9Cp39DbgoqvnkwOaWIqTdgU/Fbe2il2ng+dIWbuVGJWyXxHd0CLTKo5Ob9IJ 1rcw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:sender:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to; bh=V32gHRTQe0M9ZrgiRRBu/GPgdm/6292eQEjf3fgmmsw=; b=K7sNr5bAw9FVqyEMof7hGMma5xabIVHxny1byo25BlfOTB8lKQkPVRVmuLx/iS074s SyvCRiqqd9wHfxKZUdr99ddhUvB8rXOsAWf2+5o2iqlcP5bwoGo5MhWRMVN3bNkzHC0F 4UrrJLj015004xZZM6xtd6hTZo9hVUZIs5UXLA8cX0LQn8Vzg9eJxDHuOrwKDEiVaP3x nriln9hzjGK9xxkb9PcnMQmT7r0p1sq4l+tXOL7hBhoz6G4P6gcvVEWffnINAuOe0oWP FqExv4kmP6IFT2FuUryAvWCFbChHwBKK49Pi39KBzg8ZQITP+pmbxd/RxerCFtJzqw5g qjxA== X-Gm-Message-State: AO0yUKXJRMyp8NuNI5/z6tpfZoEwwin7hJ3acWEl+AdIMEZTyX2mGY0f hs48yBqDycXks80K2sDtvck8q9ak7Go= X-Google-Smtp-Source: AK7set+Tf+SoBntD5VEnaUccPbzvgpybPMbwE+YYdbhdmYNSZD7hAZ8jwijgmd87lZ9flWcii0Y8iQ== X-Received: by 2002:a05:6a00:47:b0:5a9:b4eb:d262 with SMTP id i7-20020a056a00004700b005a9b4ebd262mr4209575pfk.1.1677627556958; Tue, 28 Feb 2023 15:39:16 -0800 (PST) Received: from localhost (252.157.168.34.bc.googleusercontent.com. [34.168.157.252]) by smtp.gmail.com with ESMTPSA id k26-20020aa790da000000b005d6dff9bbecsm6611807pfk.62.2023.02.28.15.39.16 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 28 Feb 2023 15:39:16 -0800 (PST) Sender: Junio C Hamano From: Junio C Hamano To: git@vger.kernel.org Cc: Jeff King Subject: [PATCH 04/20] t5551: drop redundant grep for Accept-Language Date: Tue, 28 Feb 2023 15:38:57 -0800 Message-Id: <20230228233913.684853-4-gitster@pobox.com> X-Mailer: git-send-email 2.40.0-rc0-32-ga0f05f6840 In-Reply-To: <20230228233913.684853-1-gitster@pobox.com> References: <20230228233913.684853-1-gitster@pobox.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: git@vger.kernel.org From: Jeff King Commit b0c4adcdd7 (remote-curl: send Accept-Language header to server, 2022-07-11) added tests to make sure the header is sent via HTTP. However, it checks in two places: 1. In the expected trace output, we check verbatim for the header and its value. 2. Afterwards, we grep for the header again in the trace file. This (2) is probably cargo-culted from the earlier grep for Accept-Encoding. It is needed for the encoding because we smudge the value of that header when doing the verbatim check; see 1a53e692af (remote-curl: accept all encodings supported by curl, 2018-05-22). But we don't do so for the language header, so any problem that the "grep" would catch in (2) would already have been caught by (1). Signed-off-by: Jeff King Signed-off-by: Junio C Hamano --- t/t5551-http-fetch-smart.sh | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/t/t5551-http-fetch-smart.sh b/t/t5551-http-fetch-smart.sh index 10b7e7cda2..29d489768e 100755 --- a/t/t5551-http-fetch-smart.sh +++ b/t/t5551-http-fetch-smart.sh @@ -103,10 +103,7 @@ test_expect_success 'clone http repository' ' test_cmp exp actual.smudged && grep "Accept-Encoding:.*gzip" actual >actual.gzip && - test_line_count = 2 actual.gzip && - - grep "Accept-Language: ko-KR, *" actual >actual.language && - test_line_count = 2 actual.language + test_line_count = 2 actual.gzip fi ' From patchwork Tue Feb 28 23:38:58 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Junio C Hamano X-Patchwork-Id: 13155355 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 8C374C64EC7 for ; Tue, 28 Feb 2023 23:39:28 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229986AbjB1Xj1 (ORCPT ); Tue, 28 Feb 2023 18:39:27 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:54320 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229701AbjB1XjT (ORCPT ); Tue, 28 Feb 2023 18:39:19 -0500 Received: from mail-pj1-x1036.google.com (mail-pj1-x1036.google.com [IPv6:2607:f8b0:4864:20::1036]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C48F0211F2 for ; Tue, 28 Feb 2023 15:39:18 -0800 (PST) Received: by mail-pj1-x1036.google.com with SMTP id k21-20020a17090aaa1500b002376652e160so11279511pjq.0 for ; Tue, 28 Feb 2023 15:39:18 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:sender:from:to:cc:subject:date :message-id:reply-to; bh=NxNjxDkeNjgZcquqBLRA26yLYAectYct0U6ehvmfJK8=; b=XZor2IkP3D8O17fduKFU9jEXoOm0mJj7A8S2y1bow0h8257KMJVVY7lDY2/JCq/XBj xFS3vKNxXSDD5oXPjuo0DgiKd4uNLlEz2DPRHE9zsPat4Xug9aD6Fejw9XRlNtjejoDu vUklCMYsRdmIrLGdZxKN+RssqK+iN/4bt6rRxnb+7CvL2RuXytJIlqpgPJrutOyO3xc0 wMRucJGvD0xq1cRwO3Z37KknDJ9yk8K5P1hIY/bAIcAlpfpCYD7pG3tx5wb4ad2WLP3G a2pbNzCLJbtclfvu1y+a6LyXNSvwFXKrB8ViNEhT+AZ50OLr5qfFUBXc/utEEd7ft8NB yh3Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:sender:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to; bh=NxNjxDkeNjgZcquqBLRA26yLYAectYct0U6ehvmfJK8=; b=2iVBJNgZNQ1/pKXJCALMkHYtvcwhAbrYyOYxevBj6CPCgyeqckqNJKH6EvqrGwT9ZD Nsz8U62q0FwyotBd5XobUIhIy5v8bfce1VoI/GW627K2ekrSJ5zlODLP3kLsIyUXmOJJ xZh0nRActga1zfpEn3NlQTTonqeLGOC2SImBN+rP6/QevXeSPE6+rGd4+/ARE5zF7Gpn NCAUOlxtJHuRJSVta4vZSR/EcvTLkn7ljXQKQOBQ7niLwirDdWganM8JU3qcVoJ1PL6d NlqQzvScX+aMwacuXz4DWVoT2uojfnFZmhS+aQR/NG3NIqncVvfdOThCIQjSauQB29zU MBfA== X-Gm-Message-State: AO0yUKUSxhp+Yu3+QTZUv2i7PTcHgNtO/wGC3DRzQ23tJkIqBnGYF3q/ oLcWIevSA5JaPSO7FyGhGXosKcJGaLE= X-Google-Smtp-Source: AK7set/JH+wfgtm0BOo4oROKdAx5WHCqQcIt9NkPiZq5ycoUndz+NQIf+w6g+FOcOwvxEB4SwOsFyg== X-Received: by 2002:a05:6a20:3d8c:b0:cb:b92c:b46e with SMTP id s12-20020a056a203d8c00b000cbb92cb46emr4896451pzi.9.1677627557931; Tue, 28 Feb 2023 15:39:17 -0800 (PST) Received: from localhost (252.157.168.34.bc.googleusercontent.com. [34.168.157.252]) by smtp.gmail.com with ESMTPSA id d19-20020aa78693000000b005dae7d1b61asm6559286pfo.154.2023.02.28.15.39.17 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 28 Feb 2023 15:39:17 -0800 (PST) Sender: Junio C Hamano From: Junio C Hamano To: git@vger.kernel.org Cc: Jeff King Subject: [PATCH 05/20] t5551: lower-case headers in expected curl trace Date: Tue, 28 Feb 2023 15:38:58 -0800 Message-Id: <20230228233913.684853-5-gitster@pobox.com> X-Mailer: git-send-email 2.40.0-rc0-32-ga0f05f6840 In-Reply-To: <20230228233913.684853-1-gitster@pobox.com> References: <20230228233913.684853-1-gitster@pobox.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: git@vger.kernel.org From: Jeff King There's a test in t5551 which checks the curl trace (after simplifying it a bit). It doesn't work with HTTP/2, because in that case curl outputs all of the headers in lower-case. Even though this test is run with HTTP/2 by t5559, nobody has noticed because checking the trace only happens if GIT_TEST_PROTOCOL_VERSION is manually set to "0". Let's fix this by lower-casing all of the header names in the trace, and then checking for those in our expected code (this is easier than making HTTP/2 traces look like HTTP/1.1, since HTTP/1.1 uses title-casing). Sadly, we can't quite do this in our existing sed script. This works if you have GNU sed: s/^\\([><]\\) \\([A-Za-z0-9-]*:\\)/\1 \L\2\E/ but \L is a GNU-ism, and I don't think there's a portable solution. We could just "tr A-Z a-z" on the way in, of course, but that makes the non-header parts harder to read (e.g., lowercase "post" requests). But to paraphrase Baron Munchausen, I have learned from experience that a modicum of Perl can be most efficacious. Note that this doesn't quite get the test passing with t5559; there are more fixes needed on top. Signed-off-by: Jeff King Signed-off-by: Junio C Hamano --- t/t5551-http-fetch-smart.sh | 55 ++++++++++++++++++++----------------- 1 file changed, 30 insertions(+), 25 deletions(-) diff --git a/t/t5551-http-fetch-smart.sh b/t/t5551-http-fetch-smart.sh index 29d489768e..a81f852cbf 100755 --- a/t/t5551-http-fetch-smart.sh +++ b/t/t5551-http-fetch-smart.sh @@ -35,30 +35,35 @@ setup_askpass_helper test_expect_success 'clone http repository' ' cat >exp <<-\EOF && > GET /smart/repo.git/info/refs?service=git-upload-pack HTTP/1.1 - > Accept: */* - > Accept-Encoding: ENCODINGS - > Accept-Language: ko-KR, *;q=0.9 - > Pragma: no-cache + > accept: */* + > accept-encoding: ENCODINGS + > accept-language: ko-KR, *;q=0.9 + > pragma: no-cache < HTTP/1.1 200 OK - < Pragma: no-cache - < Cache-Control: no-cache, max-age=0, must-revalidate - < Content-Type: application/x-git-upload-pack-advertisement + < pragma: no-cache + < cache-control: no-cache, max-age=0, must-revalidate + < content-type: application/x-git-upload-pack-advertisement > POST /smart/repo.git/git-upload-pack HTTP/1.1 - > Accept-Encoding: ENCODINGS - > Content-Type: application/x-git-upload-pack-request - > Accept: application/x-git-upload-pack-result - > Accept-Language: ko-KR, *;q=0.9 - > Content-Length: xxx + > accept-encoding: ENCODINGS + > content-type: application/x-git-upload-pack-request + > accept: application/x-git-upload-pack-result + > accept-language: ko-KR, *;q=0.9 + > content-length: xxx < HTTP/1.1 200 OK - < Pragma: no-cache - < Cache-Control: no-cache, max-age=0, must-revalidate - < Content-Type: application/x-git-upload-pack-result + < pragma: no-cache + < cache-control: no-cache, max-age=0, must-revalidate + < content-type: application/x-git-upload-pack-result EOF GIT_TRACE_CURL=true GIT_TEST_PROTOCOL_VERSION=0 LANGUAGE="ko_KR.UTF-8" \ git clone --quiet $HTTPD_URL/smart/repo.git clone 2>err && test_cmp file clone/file && tr '\''\015'\'' Q / } - /^> User-Agent: /d - /^> Host: /d + /^> user-agent: /d + /^> host: /d /^> POST /,$ { /^> Accept: [*]\\/[*]/d } - s/^> Content-Length: .*/> Content-Length: xxx/ + s/^> content-length: .*/> content-length: xxx/ /^> 00..want /d /^> 00.*done/d - /^< Server: /d - /^< Expires: /d - /^< Date: /d - /^< Content-Length: /d - /^< Transfer-Encoding: /d + /^< server: /d + /^< expires: /d + /^< date: /d + /^< content-length: /d + /^< transfer-encoding: /d " >actual && # NEEDSWORK: If the overspecification of the expected result is reduced, we # might be able to run this test in all protocol versions. if test "$GIT_TEST_PROTOCOL_VERSION" = 0 then - sed -e "s/^> Accept-Encoding: .*/> Accept-Encoding: ENCODINGS/" \ + sed -e "s/^> accept-encoding: .*/> accept-encoding: ENCODINGS/" \ actual >actual.smudged && test_cmp exp actual.smudged && - grep "Accept-Encoding:.*gzip" actual >actual.gzip && + grep "accept-encoding:.*gzip" actual >actual.gzip && test_line_count = 2 actual.gzip fi ' From patchwork Tue Feb 28 23:38:59 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Junio C Hamano X-Patchwork-Id: 13155354 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 17489C64EC4 for ; Tue, 28 Feb 2023 23:39:31 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229927AbjB1Xj3 (ORCPT ); Tue, 28 Feb 2023 18:39:29 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:54590 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229653AbjB1Xj0 (ORCPT ); Tue, 28 Feb 2023 18:39:26 -0500 Received: from mail-pg1-x52e.google.com (mail-pg1-x52e.google.com [IPv6:2607:f8b0:4864:20::52e]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 280F5199CE for ; Tue, 28 Feb 2023 15:39:20 -0800 (PST) Received: by mail-pg1-x52e.google.com with SMTP id q23so6701990pgt.7 for ; Tue, 28 Feb 2023 15:39:19 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:sender:from:to:cc:subject:date :message-id:reply-to; bh=XDkrS7zfhNNpyFxaR0v0V4i8sTNpZgdrMYGAYMusGx8=; b=HA7NvZi0axJmZ13SrHr1dXuaqecp8/MWop4A5sifKqwJ6SjJguRNze9pMV7OsDrO/X n8rj4FzLt+ia5BWK9UjD/4jZwbyAVufiBoaH3dnex2G3AS4cjPDZqCi6xoS+d570XMuj myviMeVy7XzYBecdhL+3eoMWB1paw4HAoCjMhxdCIqTUIK/XegP9DsI3c/r4cEWZJp6x /TZyZYerYjOGwUCMJVUAYdAKIFJAbh2kBhPHpcSaPWchPzWeEZz/y1pSFDa2e1QAM/6G MOUsaknKVh04tgoATVYMCVwz4O06pFBoN0vHzRuKcEgkKzvL31WBAsYzL28Owno9UHTp 0M7A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:sender:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to; bh=XDkrS7zfhNNpyFxaR0v0V4i8sTNpZgdrMYGAYMusGx8=; b=3n/ORZzhmagZxEo+n7bmWALFvOUByGc3+4Pao7gC2atCY/jXV8qz99Jotb19IZnxI2 pJEKlx7WHNQzBbypsoKe5b/FP3RyHAiR9NJEkoVI2TTplpbAMM5ozOj78uBLc7xd6T6D ZjsL64Pn+/P9fgv8DzwGIzWmb9nJePswPJdUK5laZzkqGM9ye2cOAMBpvHyHOgbEXUmQ LVsRtgqXuAvzcp+z86/THp0aq3o4mYTJgBK/qrJ2vR7/67OtMWfQvbx6WgDhzQ2f48Gk rOK22nFAJWIZ/AQW/auXy4PZ+XMxdW5cr3XlGGyDOKSyzc4ebGj7Sv/p3XNsD5pwCtbl mlVQ== X-Gm-Message-State: AO0yUKUUJpLen8VecBkTtUodfjS8Z5FRv8bAQJe0fuOQu3lPDFxF3GKr KbxbJ96QNJkanIvO2CEst4a9HHshILQ= X-Google-Smtp-Source: AK7set+EKYx4cIVXUM8xRSNNmwt8KyBEK4oDDJrs6MbtiYJn1fCWTW/LB/0/Opok+mwoWaseoUlUsg== X-Received: by 2002:aa7:8f33:0:b0:5aa:464e:8c46 with SMTP id y19-20020aa78f33000000b005aa464e8c46mr3737524pfr.22.1677627558966; Tue, 28 Feb 2023 15:39:18 -0800 (PST) Received: from localhost (252.157.168.34.bc.googleusercontent.com. [34.168.157.252]) by smtp.gmail.com with ESMTPSA id t20-20020a62ea14000000b005a91d570972sm6572459pfh.41.2023.02.28.15.39.18 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 28 Feb 2023 15:39:18 -0800 (PST) Sender: Junio C Hamano From: Junio C Hamano To: git@vger.kernel.org Cc: Jeff King Subject: [PATCH 06/20] t5551: handle HTTP/2 when checking curl trace Date: Tue, 28 Feb 2023 15:38:59 -0800 Message-Id: <20230228233913.684853-6-gitster@pobox.com> X-Mailer: git-send-email 2.40.0-rc0-32-ga0f05f6840 In-Reply-To: <20230228233913.684853-1-gitster@pobox.com> References: <20230228233913.684853-1-gitster@pobox.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: git@vger.kernel.org From: Jeff King We check that the curl trace of a clone has the lines we expect, but this won't work when we run the test under t5559, because a few details are different under HTTP/2 (but nobody noticed because it only happens when you manually set GIT_TEST_PROTOCOL_VERSION to "0"). We can handle both HTTP protocols with a few tweaks: - we'll drop the HTTP "101 Switching Protocols" response, as well as various protocol upgrade headers. These details aren't interesting to us. We just want to make sure the correct protocol was used (and we do in the main request/response lines). - successful HTTP/2 responses just say "200" and not "200 OK"; we can normalize these - replace HTTP/1.1 with a variable in the request/response lines. We can use the existing $HTTP_PROTO for this, as it's already set to "HTTP/2" when appropriate. We do need to tweak the fallback value to "HTTP/1.1" to match what curl will write (prior to this patch, the fallback value didn't matter at all; we only checked if it was the literal string "HTTP/2"). Note that several lines still expect HTTP/1.1 unconditionally. The first request does so because the client requests an upgrade during the request. The POST request and response do so because you can't do an upgrade if there is a request body. (This will all be different if we trigger HTTP/2 via ALPN, but the tests aren't yet capable of that). This is enough to let: GIT_TEST_PROTOCOL_VERSION=0 ./t5559-http-fetch-smart-http2.sh pass the "clone http repository" test (but there are some other failures later on). Signed-off-by: Jeff King Signed-off-by: Junio C Hamano --- t/t5551-http-fetch-smart.sh | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/t/t5551-http-fetch-smart.sh b/t/t5551-http-fetch-smart.sh index a81f852cbf..716c9dbb69 100755 --- a/t/t5551-http-fetch-smart.sh +++ b/t/t5551-http-fetch-smart.sh @@ -1,6 +1,6 @@ #!/bin/sh -: ${HTTP_PROTO:=HTTP} +: ${HTTP_PROTO:=HTTP/1.1} test_description="test smart fetching over http via http-backend ($HTTP_PROTO)" GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME @@ -33,13 +33,13 @@ test_expect_success 'create http-accessible bare repository' ' setup_askpass_helper test_expect_success 'clone http repository' ' - cat >exp <<-\EOF && + cat >exp <<-EOF && > GET /smart/repo.git/info/refs?service=git-upload-pack HTTP/1.1 > accept: */* > accept-encoding: ENCODINGS > accept-language: ko-KR, *;q=0.9 > pragma: no-cache - < HTTP/1.1 200 OK + < $HTTP_PROTO 200 OK < pragma: no-cache < cache-control: no-cache, max-age=0, must-revalidate < content-type: application/x-git-upload-pack-advertisement @@ -83,6 +83,14 @@ test_expect_success 'clone http repository' ' s/^/> / } + /^< HTTP/ { + s/200$/200 OK/ + } + /^< HTTP\\/1.1 101/d + /^[><] connection: /d + /^[><] upgrade: /d + /^> http2-settings: /d + /^> user-agent: /d /^> host: /d /^> POST /,$ { From patchwork Tue Feb 28 23:39:00 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Junio C Hamano X-Patchwork-Id: 13155356 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 896A7C7EE30 for ; Tue, 28 Feb 2023 23:39:32 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229751AbjB1Xjb (ORCPT ); Tue, 28 Feb 2023 18:39:31 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:54366 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229777AbjB1Xj0 (ORCPT ); Tue, 28 Feb 2023 18:39:26 -0500 Received: from mail-pf1-x430.google.com (mail-pf1-x430.google.com [IPv6:2607:f8b0:4864:20::430]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 71CB73609B for ; Tue, 28 Feb 2023 15:39:21 -0800 (PST) Received: by mail-pf1-x430.google.com with SMTP id bd34so6869804pfb.3 for ; Tue, 28 Feb 2023 15:39:21 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:sender:from:to:cc:subject:date :message-id:reply-to; bh=gmQIfvR6sGlibKkQsUp0patzTvkeOkSSdQVGwNSYYgw=; b=EYhhc6ufcDWUgWdHPypxM6TF30/As5rRT/kT6IJqBTPULYXPwKlbotaSIULX2xVDVf 9okK1Qu1zabcXmiWkxFd9uek5dXANjtk6r0/ckZiu6rlOLFXfwVdzVKFdLjS3yxMtY2N IB8AL8fZ0i9jNcVmFgW3J1imvNZGE+gzq5dW6jLGEa5gaiY0300/EP8JKw2HioYjpU94 5r8oskMj9/7q5pwaJnXJx8G0Xlb08pidnLXqUFD4aUoCY9VbcnLGV0w/cXN5gEmMsawC loXuKX3SN7sXRB9HK02DEjZ6hzCcU4vjnayhgT3YY9wcyWqMzV3n9OfJTfIvKZW+Cur7 UlPg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:sender:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to; bh=gmQIfvR6sGlibKkQsUp0patzTvkeOkSSdQVGwNSYYgw=; b=39VlLCRAITtxkPT1LyIuX/c4/Txw48I0R1p/oQXpbX8JcTo1bPHvPV8XBnRLdVvS0L dx0aSozxuO2V0gWMwtaLucWCAQbTQbh/AvM/2CwtjM0p+YRlI/GyioTGGXPHKtOFuDLy /gBbCk+ZNmdZWK78fItBSIBeK1zp5vCFw8+vzTN19YcXZkPVPj7KLSH8NvDlYteMmdmW NCEhDphoJ3ikLYzmm02mu52sVV4pGStSgBbIdpdb93UIF/OiazvVjzUwHr0Oce3Z/itR P60wfv43CL7mlzv+JtQhkts7cCtrWsT0NLzmxDA5QdVR62TSebeYszTRLr6pW+yUwM3+ aS9g== X-Gm-Message-State: AO0yUKUL/PlVqcx28ZEG88M9b+nu6uCz33nxLBr/WduIi7aBSnl4fPpo yD6W+kL3hR7csqheOw1LLIvkNGWbuBs= X-Google-Smtp-Source: AK7set+4QrZkJy2hlEzeFW+qE/0YuSTUzeqdhQ3fyqpehRFjzzTSjjpyoQRpeonIvBa4576qnpxUUA== X-Received: by 2002:aa7:9eda:0:b0:5a8:a263:7f4d with SMTP id r26-20020aa79eda000000b005a8a2637f4dmr3590478pfq.15.1677627559930; Tue, 28 Feb 2023 15:39:19 -0800 (PST) Received: from localhost (252.157.168.34.bc.googleusercontent.com. [34.168.157.252]) by smtp.gmail.com with ESMTPSA id c9-20020aa78e09000000b005a7bd10bb2asm6610996pfr.79.2023.02.28.15.39.19 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 28 Feb 2023 15:39:19 -0800 (PST) Sender: Junio C Hamano From: Junio C Hamano To: git@vger.kernel.org Cc: Jeff King Subject: [PATCH 07/20] t5551: stop forcing clone to run with v0 protocol Date: Tue, 28 Feb 2023 15:39:00 -0800 Message-Id: <20230228233913.684853-7-gitster@pobox.com> X-Mailer: git-send-email 2.40.0-rc0-32-ga0f05f6840 In-Reply-To: <20230228233913.684853-1-gitster@pobox.com> References: <20230228233913.684853-1-gitster@pobox.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: git@vger.kernel.org From: Jeff King In the "clone http repository" test, we check the curl trace to make sure the expected requests were made. This whole script was marked to handle only the v0 protocol in d790ee1707 (tests: fix protocol version for overspecifications, 2019-02-25). That makes sense, since v2 requires an extra request, so tests as specific as this would fail unless modified. Later, in preparation for v2 becoming the default, this was tweaked by 8a1b0978ab (test: request GIT_TEST_PROTOCOL_VERSION=0 when appropriate, 2019-12-23). There we run the trace check only if the user has explicitly asked to test protocol version 0. But it also forced the clone itself to run with the v0 protocol. This makes the check for "can we expect a v0 trace" silly; it will always be v0. But much worse, it means that the clone we are testing is not like the one that normal users would run. They would use the defaults, which are now v2. And since this is supposed to be a basic check of clone-over-http, we should do the same. Let's fix this by dropping the extra v0 override. The test still passes because the trace checking only kicks in if we asked to use v0 explicitly (this is the same as before; even though we were running a v0 clone, unless you specifically set GIT_TEST_PROTOCOL_VERSION=0, the trace check was always skipped). Signed-off-by: Jeff King Signed-off-by: Junio C Hamano --- t/t5551-http-fetch-smart.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/t/t5551-http-fetch-smart.sh b/t/t5551-http-fetch-smart.sh index 716c9dbb69..4191174584 100755 --- a/t/t5551-http-fetch-smart.sh +++ b/t/t5551-http-fetch-smart.sh @@ -55,7 +55,7 @@ test_expect_success 'clone http repository' ' < content-type: application/x-git-upload-pack-result EOF - GIT_TRACE_CURL=true GIT_TEST_PROTOCOL_VERSION=0 LANGUAGE="ko_KR.UTF-8" \ + GIT_TRACE_CURL=true LANGUAGE="ko_KR.UTF-8" \ git clone --quiet $HTTPD_URL/smart/repo.git clone 2>err && test_cmp file clone/file && tr '\''\015'\'' Q X-Patchwork-Id: 13155357 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id C165DC64EC7 for ; Tue, 28 Feb 2023 23:39:35 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229777AbjB1Xjd (ORCPT ); Tue, 28 Feb 2023 18:39:33 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:54590 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229904AbjB1Xj0 (ORCPT ); Tue, 28 Feb 2023 18:39:26 -0500 Received: from mail-pf1-x42f.google.com (mail-pf1-x42f.google.com [IPv6:2607:f8b0:4864:20::42f]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 71B3F1E9FA for ; Tue, 28 Feb 2023 15:39:21 -0800 (PST) Received: by mail-pf1-x42f.google.com with SMTP id n5so6837897pfv.11 for ; Tue, 28 Feb 2023 15:39:21 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:sender:from:to:cc:subject:date :message-id:reply-to; bh=Syi9vijVL7Q/2pM2l3efi+7l0N2Gh0Ss7ILslH1zD2U=; b=K8Rftfv2b8TXOpJaeOKvhjVRttj0a3DOOUJcgct5BGYriQNx3f6zsY0AfQT6V30cfZ MV9hiqtvqwUS2zpRFwySdo5B4Y4x/OhmrAtYD6WOT70CgZsHkJ5nn7+ejzf+zlqTfZQX /iYTsIjhebRrVG/6yKRNATQoGLJ9Cd1FGhd8FPL+HFnW6kcbTud6/TAvMPW3KgR8LQFX /8uuvxRLwyBbnRGP1Q99S/2m3WQJqNkCYigmRSFNnS61i4kPX9PDctU7wAGRby/f0gWi AGI3esAn01xLp82bjXFkV5YUhC+0cdxRatLbDBVV6/FDXA0pUGE4zaOEnJ9jvQyVbJpa 4U6A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:sender:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to; bh=Syi9vijVL7Q/2pM2l3efi+7l0N2Gh0Ss7ILslH1zD2U=; b=D8nMvHFN1u1BgmzIxgaMYXjFMgnMaaSfVX9mOSIxXHbtC26cb8/au2stLxWWJe/D9r PXYgDSkbHFtVC0uMkeADREb0o4MXrMsWOa3G3FaKybnbWuBWxxTyovKE9+IKO/SAUc2B Un9I+QxxxnoMpd/7g+J8jYaY/neHW9+BzHFvEGlcGid+Ow+6rexQ62OIXPlPzKmRN3xL QfMEE1LtpLSRxOP5h5O4qyHqW/rz7pazyIyuIZvdu3wLDNvlt948hSHlML8tYrwecODC BWYIUwFcfkavnpPQoNaBo+A2JP9sDmbVA6n6TqhUlpg6HPKUKlbBAeQfey1qibQYCZ69 ghkg== X-Gm-Message-State: AO0yUKVBZfgsCdCN12nQKAH7ulb115ibG6V9Zq8BAbHPu/A4g/y3KNDA OIw6TtgpSCnuZSYWoH2yBhq180vAjDc= X-Google-Smtp-Source: AK7set/tcLjAGY3MpZ8IM+2poUvHM/mTGUfydNhAN6KcKWLFZnl0fyRg+DQEhQAJfQsgXUTGJjxDVg== X-Received: by 2002:a05:6a00:4c8f:b0:5a8:473e:2fdc with SMTP id eb15-20020a056a004c8f00b005a8473e2fdcmr13378833pfb.12.1677627560553; Tue, 28 Feb 2023 15:39:20 -0800 (PST) Received: from localhost (252.157.168.34.bc.googleusercontent.com. [34.168.157.252]) by smtp.gmail.com with ESMTPSA id a17-20020aa780d1000000b00588e0d5124asm6523905pfn.160.2023.02.28.15.39.20 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 28 Feb 2023 15:39:20 -0800 (PST) Sender: Junio C Hamano From: Junio C Hamano To: git@vger.kernel.org Cc: Jeff King Subject: [PATCH 08/20] t5551: handle v2 protocol when checking curl trace Date: Tue, 28 Feb 2023 15:39:01 -0800 Message-Id: <20230228233913.684853-8-gitster@pobox.com> X-Mailer: git-send-email 2.40.0-rc0-32-ga0f05f6840 In-Reply-To: <20230228233913.684853-1-gitster@pobox.com> References: <20230228233913.684853-1-gitster@pobox.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: git@vger.kernel.org From: Jeff King After cloning an http repository, we check the curl trace to make sure the expected requests were made. But since the expected trace was never updated to handle v2, it is only run when you ask the test suite to run in v0 mode (which hardly anybody does). Let's update it to handle both protocols. This isn't too hard since v2 just sends an extra header and an extra request. So we can just annotate those extra lines and strip them out for v0 (and drop the annotations for v2). I didn't bother handling v1 here, as it's not really of practical interest (it would drop the extra v2 request, but still have the "git-protocol" lines). There's a similar tweak needed at the end. Since we check the "accept-encoding" value loosely, we grep for it rather than finding it in the verbatim trace. This grep insists that there are exactly 2 matches, but of course in v2 with the extra request there are 3. We could tweak the number, but it's simpler still to just check that we saw at least one match. The verbatim check already confirmed how many instances of the header we have; we're really just checking here that "gzip" is in the value (it's possible, of course, that the headers could have different values, but that seems like an unlikely bug). Signed-off-by: Jeff King Signed-off-by: Junio C Hamano --- t/t5551-http-fetch-smart.sh | 36 +++++++++++++++++++++++++----------- 1 file changed, 25 insertions(+), 11 deletions(-) diff --git a/t/t5551-http-fetch-smart.sh b/t/t5551-http-fetch-smart.sh index 4191174584..9d99cefb92 100755 --- a/t/t5551-http-fetch-smart.sh +++ b/t/t5551-http-fetch-smart.sh @@ -33,12 +33,13 @@ test_expect_success 'create http-accessible bare repository' ' setup_askpass_helper test_expect_success 'clone http repository' ' - cat >exp <<-EOF && + cat >exp.raw <<-EOF && > GET /smart/repo.git/info/refs?service=git-upload-pack HTTP/1.1 > accept: */* > accept-encoding: ENCODINGS > accept-language: ko-KR, *;q=0.9 > pragma: no-cache + {V2} > git-protocol: version=2 < $HTTP_PROTO 200 OK < pragma: no-cache < cache-control: no-cache, max-age=0, must-revalidate @@ -48,13 +49,32 @@ test_expect_success 'clone http repository' ' > content-type: application/x-git-upload-pack-request > accept: application/x-git-upload-pack-result > accept-language: ko-KR, *;q=0.9 + {V2} > git-protocol: version=2 > content-length: xxx < HTTP/1.1 200 OK < pragma: no-cache < cache-control: no-cache, max-age=0, must-revalidate < content-type: application/x-git-upload-pack-result + {V2} > POST /smart/repo.git/git-upload-pack HTTP/1.1 + {V2} > accept-encoding: ENCODINGS + {V2} > content-type: application/x-git-upload-pack-request + {V2} > accept: application/x-git-upload-pack-result + {V2} > accept-language: ko-KR, *;q=0.9 + {V2} > git-protocol: version=2 + {V2} > content-length: xxx + {V2} < HTTP/1.1 200 OK + {V2} < pragma: no-cache + {V2} < cache-control: no-cache, max-age=0, must-revalidate + {V2} < content-type: application/x-git-upload-pack-result EOF + if test "$GIT_TEST_PROTOCOL_VERSION" = 0 + then + sed "/^{V2}/d" exp + else + sed "s/^{V2} //" exp + fi && + GIT_TRACE_CURL=true LANGUAGE="ko_KR.UTF-8" \ git clone --quiet $HTTPD_URL/smart/repo.git clone 2>err && test_cmp file clone/file && @@ -107,17 +127,11 @@ test_expect_success 'clone http repository' ' /^< transfer-encoding: /d " >actual && - # NEEDSWORK: If the overspecification of the expected result is reduced, we - # might be able to run this test in all protocol versions. - if test "$GIT_TEST_PROTOCOL_VERSION" = 0 - then - sed -e "s/^> accept-encoding: .*/> accept-encoding: ENCODINGS/" \ - actual >actual.smudged && - test_cmp exp actual.smudged && + sed -e "s/^> accept-encoding: .*/> accept-encoding: ENCODINGS/" \ + actual >actual.smudged && + test_cmp exp actual.smudged && - grep "accept-encoding:.*gzip" actual >actual.gzip && - test_line_count = 2 actual.gzip - fi + grep "accept-encoding:.*gzip" actual >actual.gzip ' test_expect_success 'fetch changes via http' ' From patchwork Tue Feb 28 23:39:02 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Junio C Hamano X-Patchwork-Id: 13155358 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id E4868C7EE30 for ; Tue, 28 Feb 2023 23:39:37 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229794AbjB1Xjg (ORCPT ); Tue, 28 Feb 2023 18:39:36 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:54630 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229974AbjB1Xj1 (ORCPT ); Tue, 28 Feb 2023 18:39:27 -0500 Received: from mail-pj1-x102d.google.com (mail-pj1-x102d.google.com [IPv6:2607:f8b0:4864:20::102d]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id E3F92367F2 for ; Tue, 28 Feb 2023 15:39:22 -0800 (PST) Received: by mail-pj1-x102d.google.com with SMTP id m8-20020a17090a4d8800b002377bced051so15440225pjh.0 for ; Tue, 28 Feb 2023 15:39:22 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:sender:from:to:cc:subject:date :message-id:reply-to; bh=l/I+66L1IypLt7t9h2cE75ol4sjs/KWpdYIdNaT67+U=; b=o60H5dRjmlGrU/kMz3DM+OwA2bAqVrNCvBsavQ+jKe8A43dXAxWkGCP4mVmQhp6MHy xpQBJBIBNuc4+ynrN5yQUC1jCpnRb7gHZIjM54eqvPQRQ/X4VsYa6s58v4l02MgRC4MY b98PDmRHi2e2IcTJmZD7ZBF3gSJF3Tj603fC2FCKmOzg4oucAIqEu71fKQpORw3hLAWp FUwqiixgPCflispUiO13BTegc7XpCwXs88rJFJiAoKVbnK9ws6k5LjuCTZUqgLLEVKpq zaY4p7QcWvZwmR2k3Uk0JgibmEyolwBvQ/Q/Hc+x7Z8gdBDKmtyHwg8YmKB5FRdlq+MM SGWQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:sender:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to; bh=l/I+66L1IypLt7t9h2cE75ol4sjs/KWpdYIdNaT67+U=; b=ZSQ80U2LGOMu1XGStSJG3F+wzlZZfEcY87IBI+mSajkoScjhsTPTQBEhcPgAXJRlb+ 6I907iJqVgozsN5UaPttrknjQmj6J8tG7FLlPRCIlzvGE7J9artE5tsNDYWZv3Yz/3HQ MEg3gz+fx5QzXIzegiIwggvDgACovptnsGPZfpqU8OCqITRnQOr9ARgIm9zcj04CHeFG IYoD8fMef+4DmChsszNR7dijJ7op2oOqD5CInWs6P/Rr9/IAX0Uqqh1JdvB+gBoxuqeC D+C3VAiyKoSSzlzemHmZsuvB27Y9cDVq0UIAYL00j7bFR+8iQwk/Ydcwwb90O9tjoz1U F6fQ== X-Gm-Message-State: AO0yUKUu6aQkcMw/Gbz6WkWOj7myMcvKZldVAeyMg7XrObKxE0ZaXlD6 SXOYNCHe1xgLyeHYdCh9eXSYfip61BM= X-Google-Smtp-Source: AK7set8WTDULlI7c7Fv63jODehhTifGIwIWUuHB5Ru0tg/pg4+rs42E5MM09jpxzuw10bB4YGhGWQg== X-Received: by 2002:a17:902:f542:b0:19a:81c1:e743 with SMTP id h2-20020a170902f54200b0019a81c1e743mr4634593plf.2.1677627561789; Tue, 28 Feb 2023 15:39:21 -0800 (PST) Received: from localhost (252.157.168.34.bc.googleusercontent.com. [34.168.157.252]) by smtp.gmail.com with ESMTPSA id z8-20020a1709027e8800b0019a91895cdfsm7048347pla.50.2023.02.28.15.39.20 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 28 Feb 2023 15:39:21 -0800 (PST) Sender: Junio C Hamano From: Junio C Hamano To: git@vger.kernel.org Cc: Jeff King Subject: [PATCH 09/20] t5551: handle v2 protocol in upload-pack service test Date: Tue, 28 Feb 2023 15:39:02 -0800 Message-Id: <20230228233913.684853-9-gitster@pobox.com> X-Mailer: git-send-email 2.40.0-rc0-32-ga0f05f6840 In-Reply-To: <20230228233913.684853-1-gitster@pobox.com> References: <20230228233913.684853-1-gitster@pobox.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: git@vger.kernel.org From: Jeff King We perform a clone and a fetch, and then check that we saw the expected requests in Apache's access log. In the v2 protocol, there will be one extra request to /git-upload-pack for each operation (since the initial /info/refs probe is just used to upgrade the protocol). As a result, this test is a noop unless the use of the v0 protocol is forced. Which means that hardly anybody runs it, since you have to do so manually. Let's update it to handle v2 and run it always. We could do this by just conditionally adding in the extra POST lines. But if we look at the origin of the test in 7da4e2280c (test smart http fetch and push, 2009-10-30), the point is really just to make sure that the smart git-upload-pack service was used at all. So rather than counting up the individual requests, let's just make sure we saw each of the expected types. This is a bit looser, but makes maintenance easier. Since we're now matching with grep, we can also loosen the HTTP/1.1 match, which allows this test to pass when run with HTTP/2 via t5559. That lets: GIT_TEST_PROTOCOL_VERSION=0 ./t5559-http-fetch-smart-http2.sh run to completion, which previously failed (and of course it works if you use v2, as well). Signed-off-by: Jeff King Signed-off-by: Junio C Hamano --- t/t5551-http-fetch-smart.sh | 16 +++------------- 1 file changed, 3 insertions(+), 13 deletions(-) diff --git a/t/t5551-http-fetch-smart.sh b/t/t5551-http-fetch-smart.sh index 9d99cefb92..b912958518 100755 --- a/t/t5551-http-fetch-smart.sh +++ b/t/t5551-http-fetch-smart.sh @@ -143,19 +143,9 @@ test_expect_success 'fetch changes via http' ' ' test_expect_success 'used upload-pack service' ' - cat >exp <<-\EOF && - GET /smart/repo.git/info/refs?service=git-upload-pack HTTP/1.1 200 - POST /smart/repo.git/git-upload-pack HTTP/1.1 200 - GET /smart/repo.git/info/refs?service=git-upload-pack HTTP/1.1 200 - POST /smart/repo.git/git-upload-pack HTTP/1.1 200 - EOF - - # NEEDSWORK: If the overspecification of the expected result is reduced, we - # might be able to run this test in all protocol versions. - if test "$GIT_TEST_PROTOCOL_VERSION" = 0 - then - check_access_log exp - fi + strip_access_log >log && + grep "GET /smart/repo.git/info/refs?service=git-upload-pack HTTP/[0-9.]* 200" log && + grep "POST /smart/repo.git/git-upload-pack HTTP/[0-9.]* 200" log ' test_expect_success 'follow redirects (301)' '