Re: [PATCH v4 1/9] builtin/receive-pack: properly clean up keep files

Justin Tobler <[email protected]>
Newsgroups org.kernel.vger.git
Message-ID <aodyeILDMaBOX--K@denethor>
On 26/08/20 08:46AM, Patrick Steinhardt wrote:
> On Wed, Aug 19, 2026 at 04:53:03PM -0500, Justin Tobler wrote:
> What we don't verify is that the ".keep" file is getting migrated to the
> target repository and stays intact while we're updating references. So
> do we maybe want to add the following diff so that we test for the full
> lifecycle of the ".keep" file?
> 
> diff --git a/t/t5547-push-quarantine.sh b/t/t5547-push-quarantine.sh
> index 3da253cc1a..a722a01e8d 100755
> --- a/t/t5547-push-quarantine.sh
> +++ b/t/t5547-push-quarantine.sh
> @@ -83,11 +83,19 @@ test_expect_success '.keep file is removed after push' '
>  	test -f "$keep"
>  	EOF
>  
> +	# And when updating references the keep-file should have been migrated
> +	# to the actual repository.
> +	test_hook -C keep.git reference-transaction <<-\EOF &&
> +	keep="$(ls objects/pack/pack-*.keep)" &&
> +	test -f "$keep"
> +	EOF
> +
>  	test_commit foo &&
>  	git push keep.git HEAD &&
> +
> +	# Once done, there should be no ".keep" files anywhere anymore.
>  	pack="$(ls keep.git/objects/pack/pack-*.pack)" &&
>  	keep="${pack%.pack}.keep" &&
> -
>  	test_path_is_file "$pack" &&
>  	test_path_is_missing "$keep"
>  '

Makes sense, I'll add something similar in the next version. Thanks :)

-Justin
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.