]> git.ipfire.org Git - thirdparty/git.git/commit
builtin/verify-commit: stop using `the_repository`
authorUsman Akinyemi <usmanakinyemi202@gmail.com>
Fri, 7 Mar 2025 23:35:02 +0000 (05:05 +0530)
committerJunio C Hamano <gitster@pobox.com>
Sat, 8 Mar 2025 00:52:01 +0000 (16:52 -0800)
commitdb58d5a351031ec51817c1a6566ec5672ba17138
treed01b7d8e4992cd690f74788ebf39ef9c0259b2ac
parent43a839197795a7f0582efd66bc249dac89f86b68
builtin/verify-commit: stop using `the_repository`

Remove the_repository global variable in favor of the repository
argument that gets passed in "builtin/verify-commit.c".

When `-h` is passed to the command outside a Git repository, the
`run_builtin()` will call the `cmd_verify_commit()` function with `repo`
set to NULL and then early in the function, `parse_options()` call will
give the options help and exit.

Pass the repository available in the calling context to `verify_commit()`
to remove it's dependency on the global `the_repository` variable.

Mentored-by: Christian Couder <chriscool@tuxfamily.org>
Signed-off-by: Usman Akinyemi <usmanakinyemi202@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
builtin/verify-commit.c
t/t7510-signed-commit.sh