]> git.ipfire.org Git - thirdparty/git.git/commitdiff
t5500: fix mistaken $SERVER reference in helper function
authorJeff King <peff@peff.net>
Wed, 19 Jun 2024 12:52:55 +0000 (08:52 -0400)
committerJunio C Hamano <gitster@pobox.com>
Thu, 20 Jun 2024 18:06:45 +0000 (11:06 -0700)
The end of t5500 contains two tests which use a single helper function,
fetch_filter_blob_limit_zero(). It takes a parameter to point to the
path of the server repository, which we store locally as $SERVER. The
first caller uses the relative path "server", while the second points
into the httpd document root.

Commit 07ef3c6604 (fetch test: use more robust test for filtered
objects, 2019-12-23) refactored some lines, but accidentally switched
"$SERVER" to "server" in one spot. That means the second caller is
looking at the server directory from the previous test rather than its
own.

This happens to work out because the "server" directory from the first
test is still hanging around, and the contents of the two are identical.
But it was clearly not the intended behavior, and is fragile to cleaning
up the leftovers from the first test.

Signed-off-by: Jeff King <peff@peff.net>
Reviewed-by: Jonathan Nieder <jrnieder@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
t/t5500-fetch-pack.sh

index 1bc15a3f080d3930f4f726ef7ad2bb9de38d368e..b26f3676204ec1a44a49c66f8b3dd3540b5a0ac2 100755 (executable)
@@ -1046,7 +1046,7 @@ fetch_filter_blob_limit_zero () {
 
        # Ensure that commit is fetched, but blob is not
        commit=$(git -C "$SERVER" rev-parse two) &&
-       blob=$(git hash-object server/two.t) &&
+       blob=$(git hash-object "$SERVER/two.t") &&
        git -C client rev-list --objects --missing=allow-any "$commit" >oids &&
        grep "$commit" oids &&
        ! grep "$blob" oids