• Jeff King's avatar
    fsck: warn about ".git" in trees · 5c17f512
    Jeff King authored
    Having a ".git" entry inside a tree can cause confusing
    results on checkout. At the top-level, you could not
    checkout such a tree, as it would complain about overwriting
    the real ".git" directory. In a subdirectory, you might
    check it out, but performing operations in the subdirectory
    would confusingly consider the in-tree ".git" directory as
    the repository.
    
    The regular git tools already make it hard to accidentally
    add such an entry to a tree, and do not allow such entries
    to enter the index at all. Teaching fsck about it provides
    an additional safety check, and let's us avoid propagating
    any such bogosity when transfer.fsckObjects is on.
    Signed-off-by: default avatarJeff King <peff@peff.net>
    Signed-off-by: default avatarJunio C Hamano <gitster@pobox.com>
    5c17f512
fsck.c 10.1 KB