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 <johncai86@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
This commit is contained in:
@@ -191,7 +191,7 @@ static int cat_one_file(int opt, const char *exp_type, const char *obj_name,
|
||||
const char *ls_args[3] = { NULL };
|
||||
ls_args[0] = "ls-tree";
|
||||
ls_args[1] = obj_name;
|
||||
ret = cmd_ls_tree(2, ls_args, NULL);
|
||||
ret = cmd_ls_tree(2, ls_args, NULL, the_repository);
|
||||
goto cleanup;
|
||||
}
|
||||
|
||||
@@ -923,7 +923,10 @@ static int batch_option_callback(const struct option *opt,
|
||||
return 0;
|
||||
}
|
||||
|
||||
int cmd_cat_file(int argc, const char **argv, const char *prefix)
|
||||
int cmd_cat_file(int argc,
|
||||
const char **argv,
|
||||
const char *prefix,
|
||||
struct repository *repo UNUSED)
|
||||
{
|
||||
int opt = 0;
|
||||
int opt_cw = 0;
|
||||
|
||||
Reference in New Issue
Block a user