]> git.ipfire.org Git - thirdparty/git.git/commit
fsck: factor out index fsck
authorJeff King <peff@peff.net>
Fri, 24 Feb 2023 08:07:32 +0000 (03:07 -0500)
committerJunio C Hamano <gitster@pobox.com>
Fri, 24 Feb 2023 17:30:58 +0000 (09:30 -0800)
commit8840069a37e69129ed3c2792ddb172557f98e205
treefa8cbd032b973dcb9fe51c76e0dedf7a5df99729
parent768bb238c4843bf52847773a621de4dffa6b9ab5
fsck: factor out index fsck

The code to fsck an index operates directly on the_index. Let's move it
into its own function in preparation for handling the index files from
other worktrees.

Since we now have only a single reference to the_index, let's drop
our USE_THE_INDEX_VARIABLE definition and just use the_repository.index
directly. That's a minor cleanup, but also ensures that we didn't miss
any references when moving the code into fsck_index().

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