Subject: Re: [PATCH] revision.c: set-up "index_state.repo", don't segfault in pack-objects

From: Junio C Hamano <[email-masked]>
Date: Tue, 09 Aug 2022 09:55:03 -0700

Jeff King <[email-masked]> writes:

> Here's the test addition you mentioned, though I'm really not sure it's
> adding much. The source lines for both the bug/fix and the spot where we
> segfault should be identical between the two cases. It's really just
> about how we ended up calling into the code.

True, but the "non-existing index file" case is rare enough that it
would be worth to document the new way to get into the state, I
would think.

I am offline every other Tuesday and today is such a day,
so please expect no changes to the public repositories.

Thanks.

>  t/t7063-status-untracked-cache.sh | 5 +++++
>  1 file changed, 5 insertions(+)
>
> diff --git a/t/t7063-status-untracked-cache.sh b/t/t7063-status-untracked-cache.sh
> index c1f0d95036..a0e8920ffa 100755
> --- a/t/t7063-status-untracked-cache.sh
> +++ b/t/t7063-status-untracked-cache.sh
> @@ -990,4 +990,9 @@ test_expect_success 'empty repo (no index) and core.untrackedCache' '
>  	git -C emptyrepo -c core.untrackedCache=true write-tree
>  '
>  
> +test_expect_success 'empty worktree and core.untrackedCache' '
> +	git worktree add --no-checkout empty-worktree &&
> +	git -c core.untrackedCache=true gc
> +'
> +
>  test_done