Re: [PATCH v2 4/7] t0027: optimize how we reset repository state
- From
Junio C Hamano <gitster@pobox.com>
- Date
- Nov 9, 2026, 16:59 UTC
- Message-ID
- <xmqq1p8u0wlg.fsf@gitster.g>
- In-Reply-To
- <20261109-pks-gitlab-ci-speedups-v2-4-508832602d0b@pks.im>
Patrick Steinhardt <ps@pks.im> writes:
Show 5 quoted lines
> diff --git a/t/t0027-auto-crlf.sh b/t/t0027-auto-crlf.sh
> index 49dbf09da77..504a7ea54bb 100755
> --- a/t/t0027-auto-crlf.sh
> +++ b/t/t0027-auto-crlf.sh
> @@ -305,11 +305,12 @@ checkout_files () {A micronit.
Show 9 quoted lines
> pfx=eol_${ceol}_crlf_${crlf}_attr_${attr}_ &&
> for f in LF CRLF LF_mix_CR CRLF_mix_LF LF_nul
> do
> - test_expect_success "setup $f checkout ${ceol:+ with -c core.eol=$ceol}" '
> - rm -f crlf_false_attr__$f.txt &&
> - git ${ceol:+-c core.eol=$ceol} checkout -- crlf_false_attr__$f.txt
> - '
> + paths="${paths:+"$paths "}crlf_false_attr__$f.txt"
> doneWe may know that nobody has touched variable "$paths" elsewhere in this program, but I would prefer to have an explicit "let's start with an empty $paths" assignment very close to this loop to help future readers. That way they do not have to wonder and look all over to find out after what string we are appending these filenames.
Show 7 quoted lines
> + test_expect_success "setup checkout ${ceol:+ with -c core.eol=$ceol}" '
> + rm -f $paths &&
> + git ${ceol:+-c core.eol=$ceol} checkout -- $paths
> + '
>
> test_expect_success "ls-files --eol attr=$attr $ident aeol=$aeol core.autocrlf=$crlf core.eol=$ceol" '
> test_when_finished "rm expect actual" &&