Skip to content
  • Junio C Hamano's avatar
    read-tree() and unpack_trees(): use consistent limit · ca885a4f
    Junio C Hamano authored
    
    
    read-tree -m can read up to MAX_TREES, which was arbitrarily set to 8 since
    August 2007 (4 is needed to deal with 2 merge-base case).
    
    However, the updated unpack_trees() code had an advertised limit of 4
    (which it enforced).  In reality the code was prepared to take only 3
    trees and giving 4 caused it to stomp on its stack.  Rename the MAX_TREES
    constant to MAX_UNPACK_TREES, move it to the unpack-trees.h common header
    file, and use it from both places to avoid future confusion.
    
    Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
    Signed-off-by: default avatarJunio C Hamano <gitster@pobox.com>
    ca885a4f