Re: [PATCH 03/27] t1092: compare sparse-checkout to sparse-index
- From
Derrick Stolee <stolee@gmail.com>
- Date
- Jan 27, 2021, 13:30 UTC
- Message-ID
- <d652eb83-808a-946e-37ef-9112a1790199@gmail.com>
- In-Reply-To
- <CABPp-BHKva46dZ7zqhy9Ey=cKfMpBNie-2h=yq6URa40WhGDjw@mail.gmail.com>
On 1/26/2021 10:08 PM, Elijah Newren wrote:
Show 27 quoted lines
> On Mon, Jan 25, 2021 at 9:42 AM Derrick Stolee via GitGitGadget > <gitgitgadget@gmail.com> wrote: >> >> From: Derrick Stolee <dstolee@microsoft.com> >> >> Add a new 'sparse-index' repo alongside the 'full-checkout' and >> 'sparse-checkout' repos in t1092-sparse-checkout-compatibility.sh. Also >> add run_on_sparse and test_sparse_match helpers. These helpers will be >> used when the sparse index is implemented. >> >> Signed-off-by: Derrick Stolee <dstolee@microsoft.com> >> --- >> t/t1092-sparse-checkout-compatibility.sh | 29 ++++++++++++++++++++---- >> 1 file changed, 25 insertions(+), 4 deletions(-) >> >> diff --git a/t/t1092-sparse-checkout-compatibility.sh b/t/t1092-sparse-checkout-compatibility.sh >> index 8cd3e5a8d22..8876eae0fe3 100755 >> --- a/t/t1092-sparse-checkout-compatibility.sh >> +++ b/t/t1092-sparse-checkout-compatibility.sh >> @@ -7,6 +7,7 @@ test_description='compare full workdir to sparse workdir' >> test_expect_success 'setup' ' >> git init initial-repo && >> ( >> + (GIT_TEST_SPARSE_INDEX=0 && export GIT_TEST_SPARSE_INDEX) && > > I thought parentheses started a subshell; once the subshell ends, > wouldn't the setting of GIT_TEST_SPARSE_INDEX be thrown away?
I think the "export" specifically pushes the setting out of the first level of subshell. This is the recommendation that comes up if one runs
export GIT_TEST_SPARSE_INDEX=1 &&
inside a test on macOS, since this isn't completely portable.
Thanks, -Stolee