setup: stop using the_repository in verify_filename()

Stop using `the_repository` in `verify_filename()` and instead accept
the repository as a parameter. The injection of `the_repository` is thus
bumped one level higher, where callers now pass it in explicitly.

Signed-off-by: Patrick Steinhardt <ps@pks.im>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
This commit is contained in:
Patrick Steinhardt
2026-05-19 11:52:10 +02:00
committed by Junio C Hamano
parent e6a380201e
commit 6e7e50cc7b
6 changed files with 10 additions and 8 deletions

View File

@@ -280,7 +280,8 @@ static int looks_like_pathspec(const char *arg)
* diagnose_misspelt_rev == 0 for the next ones (because we already
* saw a filename, there's not ambiguity anymore).
*/
void verify_filename(const char *prefix,
void verify_filename(struct repository *repo,
const char *prefix,
const char *arg,
int diagnose_misspelt_rev)
{
@@ -288,7 +289,7 @@ void verify_filename(const char *prefix,
die(_("option '%s' must come before non-option arguments"), arg);
if (looks_like_pathspec(arg) || check_filename(prefix, arg))
return;
die_verify_filename(the_repository, prefix, arg, diagnose_misspelt_rev);
die_verify_filename(repo, prefix, arg, diagnose_misspelt_rev);
}
/*