Skip to content
  • Devin Pohly's avatar
    filter-branch: fix --prune-empty on parentless commits · a582a82d
    Devin Pohly authored and Junio C Hamano's avatar Junio C Hamano committed
    
    
    Previously, the git_commit_non_empty_tree function would always pass any
    commit with no parents to git-commit-tree, regardless of whether the
    tree was nonempty.  The new commit would then be recorded in the
    filter-branch revision map, and subsequent commits which leave the tree
    untouched would be correctly filtered.
    
    With this change, parentless commits with an empty tree are correctly
    pruned, and an empty file is recorded in the revision map, signifying
    that it was rewritten to "no commits."  This works naturally with the
    parent mapping for subsequent commits.
    
    Signed-off-by: default avatarDevin J. Pohly <djpohly@gmail.com>
    Signed-off-by: default avatarJunio C Hamano <gitster@pobox.com>
    a582a82d