Skip to content
  • Derrick Stolee's avatar
    commit-reach: properly peel tags · b67f6b26
    Derrick Stolee authored and Junio C Hamano's avatar Junio C Hamano committed
    The can_all_from_reach_with_flag() algorithm was refactored in 4fbcca4e
    
    
    "commit-reach: make can_all_from_reach... linear" but incorrectly
    assumed that all objects provided were commits. During a fetch
    negotiation, ok_to_give_up() in upload-pack.c may provide unpeeled tags
    to the 'from' array. The current code creates a segfault.
    
    Add a direct call to can_all_from_reach_with_flag() in 'test-tool reach'
    and add a test in t6600-test-reach.sh that demonstrates this segfault.
    
    Correct the issue by peeling tags when investigating the initial list
    of objects in the 'from' array.
    
    Signed-off-by: default avatarJeff King <peff@peff.net>
    Signed-off-by: default avatarDerrick Stolee <dstolee@microsoft.com>
    Signed-off-by: default avatarJunio C Hamano <gitster@pobox.com>
    b67f6b26