Skip to content
  • Jonathan Tan's avatar
    send-pack: never fetch when checking exclusions · d8bc1a51
    Jonathan Tan authored and Junio C Hamano's avatar Junio C Hamano committed
    
    
    When building the packfile to be sent, send_pack() is given a list of
    remote refs to be used as exclusions. For each ref, it first checks if
    the ref exists locally, and if it does, passes it with a "^" prefix to
    pack-objects. However, in a partial clone, the check may trigger a lazy
    fetch.
    
    The additional commit ancestry information obtained during such fetches
    may show that certain objects that would have been sent are already
    known to the server, resulting in a smaller pack being sent. But this is
    at the cost of fetching from many possibly unrelated refs, and the lazy
    fetches do not help at all in the typical case where the client is
    up-to-date with the upstream of the branch being pushed.
    
    Ensure that these lazy fetches do not occur.
    
    Signed-off-by: default avatarJonathan Tan <jonathantanmy@google.com>
    Signed-off-by: default avatarJunio C Hamano <gitster@pobox.com>
    d8bc1a51