]> git.ipfire.org Git - thirdparty/git.git/commit - fsck.c
fsck: stop checking tag->tagged
authorJeff King <peff@peff.net>
Fri, 18 Oct 2019 04:51:19 +0000 (00:51 -0400)
committerJunio C Hamano <gitster@pobox.com>
Mon, 28 Oct 2019 05:05:17 +0000 (14:05 +0900)
commit2175a0c601af269c7aa335bc7faf27e36173ca08
tree680284362b946dd799ec3dba66e6da10ff8252db
parentec65231571d9316144acac9dde49acef279c713c
fsck: stop checking tag->tagged

Way back in 92d4c85d24 (fsck-cache: fix SIGSEGV on bad tag object,
2005-05-03), we added an fsck check that the "tagged" field of a tag
struct isn't NULL. But that was mainly protecting the printing code for
"--tags", and that code wasn't moved along with the check as part of
ba002f3b28 (builtin-fsck: move common object checking code to fsck.c,
2008-02-25).

It could also serve to detect type mismatch problems (where a tag points
to object X as a commit, but really X is a blob), but it couldn't do so
reliably (we'd call lookup_commit(X), but it will only notice the
problem if we happen to have previously called lookup_blob(X) in the
same process). And as of a commit earlier in this series, we'd consider
that a parse error and complain about the object even before getting to
this point anyway.

So let's drop this "tag->tagged" check. It's not helping anything, and
getting rid of it makes the function conceptually cleaner, as it really
is just checking the buffer we feed it. In fact, we can get rid of our
one-line wrapper and just unify fsck_tag() and fsck_tag_buffer().

Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
fsck.c