diff mbox series

[v2] t5544: clarify 'hook works with partial clone' test

Message ID 20210202192417.68663-1-jacob@gitlab.com (mailing list archive)
State Accepted
Commit 2e34f74e3aec04562af7a0309ea6a8282e7eb552
Headers show
Series [v2] t5544: clarify 'hook works with partial clone' test | expand

Commit Message

Jacob Vosmaer Feb. 2, 2021, 7:24 p.m. UTC
Apply a few leftover improvements from the review of ad5df6b782
(upload-pack.c: fix filter spec quoting bug).

1. Instead of enumerating objects reachable from HEAD, enumerate all
reachable objects, because HEAD has not special significance in this
test.

2. Instead of relying on the knowledge that "? in rev-list output
means partial clone", explicitly verify that there are no blobs with
cat-file.

Signed-off-by: Jacob Vosmaer <jacob@gitlab.com>
---
 t/t5544-pack-objects-hook.sh | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

Comments

Junio C Hamano Feb. 2, 2021, 8:21 p.m. UTC | #1
Jacob Vosmaer <jacob@gitlab.com> writes:

> Apply a few leftover improvements from the review of ad5df6b782
> (upload-pack.c: fix filter spec quoting bug).
>
> 1. Instead of enumerating objects reachable from HEAD, enumerate all
> reachable objects, because HEAD has not special significance in this
> test.
>
> 2. Instead of relying on the knowledge that "? in rev-list output
> means partial clone", explicitly verify that there are no blobs with
> cat-file.
>
> Signed-off-by: Jacob Vosmaer <jacob@gitlab.com>
> ---
>  t/t5544-pack-objects-hook.sh | 5 +++--
>  1 file changed, 3 insertions(+), 2 deletions(-)

Thanks.

>
> diff --git a/t/t5544-pack-objects-hook.sh b/t/t5544-pack-objects-hook.sh
> index f5ba663d64..dd5f44d986 100755
> --- a/t/t5544-pack-objects-hook.sh
> +++ b/t/t5544-pack-objects-hook.sh
> @@ -64,8 +64,9 @@ test_expect_success 'hook works with partial clone' '
>  	test_config_global uploadpack.packObjectsHook ./hook &&
>  	test_config_global uploadpack.allowFilter true &&
>  	git clone --bare --no-local --filter=blob:none . dst.git &&
> -	git -C dst.git rev-list --objects --missing=print HEAD >objects &&
> -	grep "^?" objects
> +	git -C dst.git rev-list --objects --missing=allow-any --no-object-names --all >objects &&
> +	git -C dst.git cat-file --batch-check="%(objecttype)" <objects >types &&
> +	! grep blob types
>  '
>  
>  test_done
diff mbox series

Patch

diff --git a/t/t5544-pack-objects-hook.sh b/t/t5544-pack-objects-hook.sh
index f5ba663d64..dd5f44d986 100755
--- a/t/t5544-pack-objects-hook.sh
+++ b/t/t5544-pack-objects-hook.sh
@@ -64,8 +64,9 @@  test_expect_success 'hook works with partial clone' '
 	test_config_global uploadpack.packObjectsHook ./hook &&
 	test_config_global uploadpack.allowFilter true &&
 	git clone --bare --no-local --filter=blob:none . dst.git &&
-	git -C dst.git rev-list --objects --missing=print HEAD >objects &&
-	grep "^?" objects
+	git -C dst.git rev-list --objects --missing=allow-any --no-object-names --all >objects &&
+	git -C dst.git cat-file --batch-check="%(objecttype)" <objects >types &&
+	! grep blob types
 '
 
 test_done