On Wed, Dec 22, 2021 at 8:37 AM Ævar Arnfjörð Bjarmason <avarab@xxxxxxxxx> wrote: > > On Tue, Dec 21 2021, Han Xin wrote: > > I commented on this "find" usage in an earlier round, I think there's a > much easier way to do this. You're really just going back and forth > between checking whether or not all the objects are loose. > > I think that the below fix-up on top of this series is a better way to > do that, and more accurate. I.e. in your test here you check "! > test_cmp", which means that we could have some packed and some loose, > but really what you're meaning to check is a flip-flop between "all > loose?" and "no loose?. > > In addition to that there was no reason to hardcode "main", we can just > use HEAD. All in all I think the below fix-up makes sense: > > diff --git a/t/t5590-unpack-non-delta-objects.sh b/t/t5590-unpack-non-delta-objects.sh > index 8436cbf8db6..d78bb89225d 100755 > --- a/t/t5590-unpack-non-delta-objects.sh > +++ b/t/t5590-unpack-non-delta-objects.sh > @@ -5,9 +5,6 @@ > > test_description='Test unpack-objects with non-delta objects' > > -GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main > -export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME > - > . ./test-lib.sh > > prepare_dest () { > @@ -20,16 +17,22 @@ prepare_dest () { > fi > } > > +assert_no_loose () { > + glob=dest.git/objects/?? && > + echo "$glob" >expect && > + echo $glob >actual && Incompatible for zsh. This may work: eval "echo $glob" >actual && -- Jiang Xin