From 9b1cb5070ffb581798763eaee85cec10da969e90 Mon Sep 17 00:00:00 2001 From: John Cai Date: Fri, 13 Sep 2024 21:16:14 +0000 Subject: builtin: add a repository parameter for builtin functions In order to reduce the usage of the global the_repository, add a parameter to builtin functions that will get passed a repository variable. This commit uses UNUSED on most of the builtin functions, as subsequent commits will modify the actual builtins to pass the repository parameter down. Signed-off-by: John Cai Signed-off-by: Junio C Hamano --- builtin/checkout.c | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) (limited to 'builtin/checkout.c') diff --git a/builtin/checkout.c b/builtin/checkout.c index 4cfe6fab50..d3bc48684f 100644 --- a/builtin/checkout.c +++ b/builtin/checkout.c @@ -1953,7 +1953,10 @@ static int checkout_main(int argc, const char **argv, const char *prefix, return ret; } -int cmd_checkout(int argc, const char **argv, const char *prefix) +int cmd_checkout(int argc, + const char **argv, + const char *prefix, + struct repository *repo UNUSED) { struct checkout_opts opts = CHECKOUT_OPTS_INIT; struct option *options; @@ -2000,7 +2003,10 @@ int cmd_checkout(int argc, const char **argv, const char *prefix) checkout_usage); } -int cmd_switch(int argc, const char **argv, const char *prefix) +int cmd_switch(int argc, + const char **argv, + const char *prefix, + struct repository *repo UNUSED) { struct checkout_opts opts = CHECKOUT_OPTS_INIT; struct option *options = NULL; @@ -2036,7 +2042,10 @@ int cmd_switch(int argc, const char **argv, const char *prefix) switch_branch_usage); } -int cmd_restore(int argc, const char **argv, const char *prefix) +int cmd_restore(int argc, + const char **argv, + const char *prefix, + struct repository *repo UNUSED) { struct checkout_opts opts = CHECKOUT_OPTS_INIT; struct option *options; -- cgit 1.2.3-korg