]> git.ipfire.org Git - thirdparty/git.git/commit
builtin/refs: add verify subcommand
authorshejialuo <shejialuo@gmail.com>
Thu, 8 Aug 2024 11:27:28 +0000 (19:27 +0800)
committerJunio C Hamano <gitster@pobox.com>
Thu, 8 Aug 2024 16:36:53 +0000 (09:36 -0700)
commitbf061d26c7a595f1f46510aa584d50be1b1edb93
tree054616ecdc6fa8a604bc6ac05538b5fae45208a7
parentab6f79d8df7c7799ed38229eb56811fda36853ae
builtin/refs: add verify subcommand

Introduce a new subcommand "verify" in git-refs(1) to allow the user to
check the reference database consistency and also this subcommand will
be used as the entry point of checking refs for "git-fsck(1)".

Add "verbose" field into "fsck_options" to indicate whether we should
print verbose messages when checking refs and objects consistency.

Remove bit-field for "strict" field, this is because we cannot take
address of a bit-field which makes it unhandy to set member variables
when parsing the command line options.

The "git-fsck(1)" declares "fsck_options" variable with "static"
identifier which avoids complaint by the leak-checker. However, in
"git-refs verify", we need to do memory clean manually. Thus add
"fsck_options_clear" function in "fsck.c" to provide memory clean
operation.

Mentored-by: Patrick Steinhardt <ps@pks.im>
Mentored-by: Karthik Nayak <karthik.188@gmail.com>
Signed-off-by: shejialuo <shejialuo@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Documentation/git-refs.txt
builtin/refs.c
fsck.c
fsck.h