• Rene Scharfe's avatar
    Make git-cherry handle root trees · 2b60356d
    Rene Scharfe authored
    This patch on top of 'next' makes built-in git-cherry handle root
    It moves the static function log-tree.c::diff_root_tree() to
    tree-diff.c and makes it more similar to diff_tree_sha1() by
    shuffling around arguments and factoring out the call to
    log_tree_diff_flush().  Consequently the name is changed to
    diff_root_tree_sha1().  It is a version of diff_tree_sha1() that
    compares the empty tree (= root tree) against a single 'real' tree.
    This function is then used in get_patch_id() to compute patch IDs
    for initial commits instead of SEGFAULTing, as the current code
    does if confronted with parentless commits.
    Signed-off-by: default avatarRene Scharfe <[email protected]>
    Signed-off-by: default avatarJunio C Hamano <[email protected]>
builtin-log.c 13.6 KB