Subject: Re: [GSoC][PATCH 5/5] t: add test for git refs optimize subcommand

From: shejialuo <[email-masked]>
Date: Tue, 26 Aug 2025 23:18:18 +0800

On Tue, Aug 26, 2025 at 01:06:45PM +0530, Meet Soni wrote:

> diff --git a/t/t1463-refs-optimize.sh b/t/t1463-refs-optimize.sh
> new file mode 100755
> index 0000000000..c11c905d79
> --- /dev/null
> +++ b/t/t1463-refs-optimize.sh
> @@ -0,0 +1,17 @@
> +#!/bin/sh
> +
> +test_description='git refs optimize should not change the branch semantic
> +
> +This test runs git refs optimize and git show-ref and checks that the branch
> +semantic is still the same.
> +'

When reading the description, I am wondering how this test runs `git
refs optimize` and `git show-ref` to achieve the goal. Should we simply
just say we use "pack-refs-tests.sh" to ensure the compatibility with
the `git pack-refs`?

> +
> +GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main
> +export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
> +GIT_TEST_DEFAULT_REF_FORMAT=files
> +export GIT_TEST_DEFAULT_REF_FORMAT
> +
> +. ./test-lib.sh
> +
> +pack_refs='refs optimize'
> +. "$TEST_DIRECTORY"/pack-refs-tests.sh
> -- 
> 2.34.1
> 

Thanks,
Jialuo