Skip to content
  • Jonathan Tan's avatar
    upload-pack: teach deepen-relative in protocol v2 · 5056cf4a
    Jonathan Tan authored and Junio C Hamano's avatar Junio C Hamano committed
    Commit 685fbd32
    
     ("fetch-pack: perform a fetch using v2", 2018-03-15)
    attempted to teach Git deepen-relative in protocol v2 (among other
    things), but it didn't work:
    
     (1) fetch-pack.c needs to emit "deepen-relative".
     (2) upload-pack.c needs to ensure that the correct deepen_relative
         variable is passed to deepen() (there are two - the static variable
         and the one in struct upload_pack_data).
     (3) Before deepen() computes the list of reachable shallows, it first
         needs to mark all "our" refs as OUR_REF. v2 currently does not do
         this, because unlike v0, it is not needed otherwise.
    
    Fix all this and include a test demonstrating that it works now. For
    (2), the static variable deepen_relative is also eliminated, removing a
    source of confusion.
    
    Signed-off-by: default avatarJonathan Tan <jonathantanmy@google.com>
    Reviewed-by: default avatarJosh Steadmon <steadmon@google.com>
    Signed-off-by: default avatarJunio C Hamano <gitster@pobox.com>
    5056cf4a