Subject: [PATCH] t5617,t7814: remove unnecessary 'uploadpack.allowanysha1inwant'

From: Philippe Blain <[email-masked]>
Date: Sat, 19 Feb 2022 12:30:10 -0500

The tests added in the previous commit configure the "server"
repository with 'uploadpack.allowfilter', in order for it to act as a
promisor remote, and also with 'uploadpack.allowanysha1inwant'.

This second setting is unnecessary as it only affects protocol v0
operations; protocol v2, the default since eb049759fb (protocol:
re-enable v2 protocol by default, 2020-09-25), allows any OID in want
without any configuration needed.

Remove this config from both tests.

Signed-off-by: Philippe Blain <[email-masked]>
---

Notes:
    This is based on the version in next: f05da2b48b (clone, submodule: pass
    partial clone filters to submodules, 2022-02-04).
    
    Both tests still pass.
    
    I wondered if it would be best to add '-c protocol.version=2' later on in the
    tests, to allow runnning these tests with GIT_TEST_PROTOCOL_VERSION, but I was
    not sure.
    
    Note that as I remarked in [1] last summer, the fact that
    'allow{Tip,Reachable,Any}Sha1InWant' have no effect under protocol v2 is still
    missing from the documentation...
    
    [1] https://lore.kernel.org/git/[email-masked]/

 t/t5617-clone-submodules-remote.sh | 3 +--
 t/t7814-grep-recurse-submodules.sh | 4 +---
 2 files changed, 2 insertions(+), 5 deletions(-)

diff --git a/t/t5617-clone-submodules-remote.sh b/t/t5617-clone-submodules-remote.sh
index ca8f80083a..3fc93b1f8d 100755
--- a/t/t5617-clone-submodules-remote.sh
+++ b/t/t5617-clone-submodules-remote.sh
@@ -31,8 +31,7 @@ test_expect_success 'setup' '
 # bare clone giving "srv.bare" for use as our server.
 test_expect_success 'setup bare clone for server' '
 	git clone --bare "file://$(pwd)/." srv.bare &&
-	git -C srv.bare config --local uploadpack.allowfilter 1 &&
-	git -C srv.bare config --local uploadpack.allowanysha1inwant 1
+	git -C srv.bare config --local uploadpack.allowfilter 1
 '
 
 test_expect_success 'clone with --no-remote-submodules' '
diff --git a/t/t7814-grep-recurse-submodules.sh b/t/t7814-grep-recurse-submodules.sh
index a4476dc492..1c9aec06a3 100755
--- a/t/t7814-grep-recurse-submodules.sh
+++ b/t/t7814-grep-recurse-submodules.sh
@@ -563,9 +563,7 @@ test_expect_success 'grep partially-cloned submodule' '
 		git commit -m "Update submodule" &&
 		test_tick &&
 		git config --local uploadpack.allowfilter 1 &&
-		git config --local uploadpack.allowanysha1inwant 1 &&
-		git -C sub config --local uploadpack.allowfilter 1 &&
-		git -C sub config --local uploadpack.allowanysha1inwant 1
+		git -C sub config --local uploadpack.allowfilter 1
 	) &&
 	# Clone the superproject & submodule, then make sure we can lazy-fetch submodule objects.
 	git clone --filter=blob:none --also-filter-submodules \

base-commit: f05da2b48b48a46db65fc768b3ffecaf996dd655
-- 
2.29.2