Skip to content
  • Junio C Hamano's avatar
    fsck.c: fix bogus "empty tree" check · 79b1138e
    Junio C Hamano authored
    ba002f3b
    
     (builtin-fsck: move common object checking code to fsck.c) did
    more than what it claimed to.  Most notably, it wrongly made an empty tree
    object an error by pretending to only move code from fsck_tree() in
    builtin-fsck.c to fsck_tree() in fsck.c, but in fact adding a bogus check
    to barf on an empty tree.
    
    An empty tree object is _unusual_.  Recent porcelains try reasonably hard
    not to let the user create a commit that contains such a tree.  Perhaps
    warning about them in git-fsck may have some merit.
    
    HOWEVER.
    
    Being unusual and being errorneous are two quite different things.  This
    is especially true now we seem to use the same fsck_$object() code in
    places other than git-fsck itself.  For example, receive-pack should not
    reject unusual objects, even if it would be a good idea to tighten it to
    reject incorrect ones.
    
    Signed-off-by: default avatarJunio C Hamano <gitster@pobox.com>
    79b1138e