Thread (183 messages) 183 messages, 9 authors, 2022-06-11

Re: [PATCH v7 1/5] unpack-objects.c: add dry_run mode for get_data()

From: Jiang Xin <hidden>
Date: 2021-12-22 11:29:55

On Wed, Dec 22, 2021 at 8:37 AM Ævar Arnfjörð Bjarmason
[off-list ref] wrote:
quoted hunk ↗ jump to hunk
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
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help