]> Kevux Git Server - rit/commit
builtin/for-each-ref: stop using `the_repository`
authorUsman Akinyemi <usmanakinyemi202@gmail.com>
Fri, 7 Mar 2025 23:35:06 +0000 (05:05 +0530)
committerJunio C Hamano <gitster@pobox.com>
Sat, 8 Mar 2025 00:52:02 +0000 (16:52 -0800)
commitd9dce89192504c63787b98961ee514937af88e61
tree0ac8d85ef817dc7d0e35f2e755fb818391dc52f3
parentd9c5cfb18f4dff87db7d28846bd754c009f6043d
builtin/for-each-ref: stop using `the_repository`

Remove the_repository global variable in favor of the repository
argument that gets passed in "builtin/for-each-ref.c".

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

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/for-each-ref.c
t/t6300-for-each-ref.sh