Re: [PATCH 1/2] partial-clone: demonstrate bugs in partial fetch
- From
Eric Sunshine <sunshine@sunshineco.com>
- Date
- Feb 19, 2020, 18:38 UTC
- Message-ID
- <CAPig+cSRQXRtSscKUUJBA0NShRQfA=NHohnA2GMRmgbpWr_MvA@mail.gmail.com>
- In-Reply-To
- <dbc1bdcae16f8b9941add514264b0fe04cda48c0.1582129312.git.gitgitgadget@gmail.com>
On Wed, Feb 19, 2020 at 11:22 AM Derrick Stolee via GitGitGadget <gitgitgadget@gmail.com> wrote:
Show 5 quoted lines
> [...] > The tests are ordered in this way because if I swap the test order the > tag test will succeed instead of fail. I believe this is because somehow > we need the srv.bare repo to not have any tags when we clone, but then > have tags in our next fetch.
This ordering requirement might deserve an in-code comment in the test script itself.
More below...
Show 11 quoted lines
> Signed-off-by: Derrick Stolee <dstolee@microsoft.com> > --- > diff --git a/t/t5616-partial-clone.sh b/t/t5616-partial-clone.sh > @@ -374,6 +374,32 @@ test_expect_success 'fetch lazy-fetches only to resolve deltas, protocol v2' ' > +test_expect_failure 'verify fetch succeeds when asking for new tags' ' > + git clone --filter=blob:none "file://$(pwd)/srv.bare" tag-test && > + for i in I J K > + do > + test_commit -C src $i && > + git -C src branch $i > + done &&
If test_commit() or git-branch fail, those failures will go unnoticed. You can fix this by bailing from the loop, like this:
for i in I J K
do
test_commit -C src $i &&
git -C src branch $i || return 1
done &&Same comment applies to the other new test.
Show 18 quoted lines
> + git -C srv.bare fetch --tags origin +refs/heads/*:refs/heads/* && > + git -C tag-test fetch --tags origin > +' > + > +test_expect_failure 'verify fetch downloads only one pack when updating refs' ' > + git clone --filter=blob:none "file://$(pwd)/srv.bare" pack-test && > + ls pack-test/.git/objects/pack/*pack >pack-list && > + test_line_count = 2 pack-list && > + for i in A B C > + do > + test_commit -C src $i && > + git -C src branch $i > + done && > + git -C srv.bare fetch origin +refs/heads/*:refs/heads/* && > + git -C pack-test fetch origin && > + ls pack-test/.git/objects/pack/*pack >pack-list && > + test_line_count = 3 pack-list > +'