Ah...yes you're right. I've updated it here.
Thanks for your review.
[1] https://public-inbox.org/git/20190326182047.GB24105@sigill.intra.peff.net/
Jonathan Tan (2):
fetch-pack: call prepare_shallow_info only if v0
fetch-pack: respect --no-update-shallow in v2
commit.h | 4 ++++
fetch-pack.c | 51 +++++++++++++++++++++++++++++++++++++++++----------
2 files changed, 45 insertions(+), 10 deletions(-)
Range-diff against v2:
1: d2eb101709 ! 1: 64f44a18ad fetch-pack: call prepare_shallow_info only if v0
@@ -38,7 +38,7 @@
- prepare_shallow_info(&si, shallow);
- if (version == protocol_v2)
+ if (version == protocol_v2) {
-+ if (shallow && shallow->nr)
++ if (shallow->nr)
+ BUG("Protocol V2 does not provide shallows at this point in the fetch");
+ memset(&si, 0, sizeof(si));
ref_cpy = do_fetch_pack_v2(args, fd, ref, sought, nr_sought,
2: 943b1cbc61 ! 2: 3f65698610 fetch-pack: respect --no-update-shallow in v2
@@ -120,11 +120,6 @@
fetch_pack_setup();
if (nr_sought)
@@
- die(_("no matching remote head"));
- }
- if (version == protocol_v2) {
-- if (shallow && shallow->nr)
-+ if (shallow->nr)
BUG("Protocol V2 does not provide shallows at this point in the fetch");
memset(&si, 0, sizeof(si));
ref_cpy = do_fetch_pack_v2(args, fd, ref, sought, nr_sought,