return res;
}
-static int cmd_bisect__reset(int argc, const char **argv, const char *prefix UNUSED)
+static int cmd_bisect__reset(int argc, const char **argv, const char *prefix UNUSED,
+ struct repository *repo UNUSED)
{
if (argc > 1)
return error(_("'%s' requires either no argument or a commit"),
return bisect_reset(argc ? argv[0] : NULL);
}
-static int cmd_bisect__terms(int argc, const char **argv, const char *prefix UNUSED)
+static int cmd_bisect__terms(int argc, const char **argv, const char *prefix UNUSED,
+ struct repository *repo UNUSED)
{
int res;
struct bisect_terms terms = { 0 };
return res;
}
-static int cmd_bisect__start(int argc, const char **argv, const char *prefix UNUSED)
+static int cmd_bisect__start(int argc, const char **argv, const char *prefix UNUSED,
+ struct repository *repo UNUSED)
{
int res;
struct bisect_terms terms = { 0 };
return res;
}
-static int cmd_bisect__next(int argc, const char **argv UNUSED, const char *prefix)
+static int cmd_bisect__next(int argc, const char **argv UNUSED, const char *prefix,
+ struct repository *repo UNUSED)
{
int res;
struct bisect_terms terms = { 0 };
return res;
}
-static int cmd_bisect__log(int argc UNUSED, const char **argv UNUSED, const char *prefix UNUSED)
+static int cmd_bisect__log(int argc UNUSED, const char **argv UNUSED,
+ const char *prefix UNUSED,
+ struct repository *repo UNUSED)
{
return bisect_log();
}
-static int cmd_bisect__replay(int argc, const char **argv, const char *prefix UNUSED)
+static int cmd_bisect__replay(int argc, const char **argv, const char *prefix UNUSED,
+ struct repository *repo UNUSED)
{
int res;
struct bisect_terms terms = { 0 };
return res;
}
-static int cmd_bisect__skip(int argc, const char **argv, const char *prefix UNUSED)
+static int cmd_bisect__skip(int argc, const char **argv, const char *prefix UNUSED,
+ struct repository *repo UNUSED)
{
int res;
struct bisect_terms terms = { 0 };
return res;
}
-static int cmd_bisect__visualize(int argc, const char **argv, const char *prefix UNUSED)
+static int cmd_bisect__visualize(int argc, const char **argv, const char *prefix UNUSED,
+ struct repository *repo UNUSED)
{
int res;
struct bisect_terms terms = { 0 };
return res;
}
-static int cmd_bisect__run(int argc, const char **argv, const char *prefix UNUSED)
+static int cmd_bisect__run(int argc, const char **argv, const char *prefix UNUSED,
+ struct repository *repo UNUSED)
{
int res;
struct bisect_terms terms = { 0 };
int cmd_bisect(int argc,
const char **argv,
const char *prefix,
- struct repository *repo UNUSED)
+ struct repository *repo)
{
int res = 0;
parse_opt_subcommand_fn *fn = NULL;
} else {
argc--;
argv++;
- res = fn(argc, argv, prefix);
+ res = fn(argc, argv, prefix, repo);
}
return is_bisect_success(res) ? 0 : -res;
return argc;
}
-static int cmd_bundle_create(int argc, const char **argv, const char *prefix) {
+static int cmd_bundle_create(int argc, const char **argv, const char *prefix,
+ struct repository *repo UNUSED) {
struct strvec pack_opts = STRVEC_INIT;
int version = -1;
int ret;
return read_bundle_header(path, header);
}
-static int cmd_bundle_verify(int argc, const char **argv, const char *prefix) {
+static int cmd_bundle_verify(int argc, const char **argv, const char *prefix,
+ struct repository *repo UNUSED) {
struct bundle_header header = BUNDLE_HEADER_INIT;
int bundle_fd = -1;
int quiet = 0;
return ret;
}
-static int cmd_bundle_list_heads(int argc, const char **argv, const char *prefix) {
+static int cmd_bundle_list_heads(int argc, const char **argv, const char *prefix,
+ struct repository *repo UNUSED) {
struct bundle_header header = BUNDLE_HEADER_INIT;
int bundle_fd = -1;
int ret;
return ret;
}
-static int cmd_bundle_unbundle(int argc, const char **argv, const char *prefix) {
+static int cmd_bundle_unbundle(int argc, const char **argv, const char *prefix,
+ struct repository *repo UNUSED) {
struct bundle_header header = BUNDLE_HEADER_INIT;
int bundle_fd = -1;
int ret;
int cmd_bundle(int argc,
const char **argv,
const char *prefix,
- struct repository *repo UNUSED)
+ struct repository *repo)
{
parse_opt_subcommand_fn *fn = NULL;
struct option options[] = {
packet_trace_identity("bundle");
- return !!fn(argc, argv, prefix);
+ return !!fn(argc, argv, prefix, repo);
}
return parse_options_concat(common_opts, to);
}
-static int graph_verify(int argc, const char **argv, const char *prefix)
+static int graph_verify(int argc, const char **argv, const char *prefix,
+ struct repository *repo UNUSED)
{
struct commit_graph *graph = NULL;
struct object_directory *odb = NULL;
return 0;
}
-static int graph_write(int argc, const char **argv, const char *prefix)
+static int graph_write(int argc, const char **argv, const char *prefix,
+ struct repository *repo UNUSED)
{
struct string_list pack_indexes = STRING_LIST_INIT_DUP;
struct strbuf buf = STRBUF_INIT;
int cmd_commit_graph(int argc,
const char **argv,
const char *prefix,
- struct repository *repo UNUSED)
+ struct repository *repo)
{
parse_opt_subcommand_fn *fn = NULL;
struct option builtin_commit_graph_options[] = {
builtin_commit_graph_usage, 0);
FREE_AND_NULL(options);
- return fn(argc, argv, prefix);
+ return fn(argc, argv, prefix, repo);
}
}
}
-static int cmd_config_list(int argc, const char **argv, const char *prefix)
+static int cmd_config_list(int argc, const char **argv, const char *prefix,
+ struct repository *repo UNUSED)
{
struct config_location_options location_opts = CONFIG_LOCATION_OPTIONS_INIT;
struct config_display_options display_opts = CONFIG_DISPLAY_OPTIONS_INIT;
return 0;
}
-static int cmd_config_get(int argc, const char **argv, const char *prefix)
+static int cmd_config_get(int argc, const char **argv, const char *prefix,
+ struct repository *repo UNUSED)
{
struct config_location_options location_opts = CONFIG_LOCATION_OPTIONS_INIT;
struct config_display_options display_opts = CONFIG_DISPLAY_OPTIONS_INIT;
return ret;
}
-static int cmd_config_set(int argc, const char **argv, const char *prefix)
+static int cmd_config_set(int argc, const char **argv, const char *prefix,
+ struct repository *repo UNUSED)
{
struct config_location_options location_opts = CONFIG_LOCATION_OPTIONS_INIT;
const char *value_pattern = NULL, *comment_arg = NULL;
return ret;
}
-static int cmd_config_unset(int argc, const char **argv, const char *prefix)
+static int cmd_config_unset(int argc, const char **argv, const char *prefix,
+ struct repository *repo UNUSED)
{
struct config_location_options location_opts = CONFIG_LOCATION_OPTIONS_INIT;
const char *value_pattern = NULL;
return ret;
}
-static int cmd_config_rename_section(int argc, const char **argv, const char *prefix)
+static int cmd_config_rename_section(int argc, const char **argv, const char *prefix,
+ struct repository *repo UNUSED)
{
struct config_location_options location_opts = CONFIG_LOCATION_OPTIONS_INIT;
struct option opts[] = {
return ret;
}
-static int cmd_config_remove_section(int argc, const char **argv, const char *prefix)
+static int cmd_config_remove_section(int argc, const char **argv, const char *prefix,
+ struct repository *repo UNUSED)
{
struct config_location_options location_opts = CONFIG_LOCATION_OPTIONS_INIT;
struct option opts[] = {
return 0;
}
-static int cmd_config_edit(int argc, const char **argv, const char *prefix)
+static int cmd_config_edit(int argc, const char **argv, const char *prefix,
+ struct repository *repo UNUSED)
{
struct config_location_options location_opts = CONFIG_LOCATION_OPTIONS_INIT;
struct option opts[] = {
int cmd_config(int argc,
const char **argv,
const char *prefix,
- struct repository *repo UNUSED)
+ struct repository *repo)
{
parse_opt_subcommand_fn *subcommand = NULL;
struct option subcommand_opts[] = {
if (subcommand) {
argc = parse_options(argc, argv, prefix, subcommand_opts, builtin_config_usage,
PARSE_OPT_SUBCOMMAND_OPTIONAL|PARSE_OPT_KEEP_UNKNOWN_OPT);
- return subcommand(argc, argv, prefix);
+ return subcommand(argc, argv, prefix, repo);
}
return cmd_config_actions(argc, argv, prefix);
return 0;
}
-static int maintenance_run(int argc, const char **argv, const char *prefix)
+static int maintenance_run(int argc, const char **argv, const char *prefix,
+ struct repository *repo UNUSED)
{
int i;
struct maintenance_run_opts opts = MAINTENANCE_RUN_OPTS_INIT;
NULL
};
-static int maintenance_register(int argc, const char **argv, const char *prefix)
+static int maintenance_register(int argc, const char **argv, const char *prefix,
+ struct repository *repo UNUSED)
{
char *config_file = NULL;
struct option options[] = {
NULL
};
-static int maintenance_unregister(int argc, const char **argv, const char *prefix)
+static int maintenance_unregister(int argc, const char **argv, const char *prefix,
+ struct repository *repo UNUSED)
{
int force = 0;
char *config_file = NULL;
NULL
};
-static int maintenance_start(int argc, const char **argv, const char *prefix)
+static int maintenance_start(int argc, const char **argv, const char *prefix,
+ struct repository *repo)
{
struct maintenance_start_opts opts = { 0 };
struct option options[] = {
if (update_background_schedule(&opts, 1))
die(_("failed to set up maintenance schedule"));
- if (maintenance_register(ARRAY_SIZE(register_args)-1, register_args, NULL))
+ if (maintenance_register(ARRAY_SIZE(register_args)-1, register_args, NULL, repo))
warning(_("failed to add repo to global config"));
return 0;
}
NULL
};
-static int maintenance_stop(int argc, const char **argv, const char *prefix)
+static int maintenance_stop(int argc, const char **argv, const char *prefix,
+ struct repository *repo UNUSED)
{
struct option options[] = {
OPT_END()
int cmd_maintenance(int argc,
const char **argv,
const char *prefix,
- struct repository *repo UNUSED)
+ struct repository *repo)
{
parse_opt_subcommand_fn *fn = NULL;
struct option builtin_maintenance_options[] = {
argc = parse_options(argc, argv, prefix, builtin_maintenance_options,
builtin_maintenance_usage, 0);
- return fn(argc, argv, prefix);
+ return fn(argc, argv, prefix, repo);
}
NULL
};
-static int run(int argc, const char **argv, const char *prefix)
+static int run(int argc, const char **argv, const char *prefix,
+ struct repository *repo UNUSED)
{
int i;
struct run_hooks_opt opt = RUN_HOOKS_OPT_INIT;
int cmd_hook(int argc,
const char **argv,
const char *prefix,
- struct repository *repo UNUSED)
+ struct repository *repo)
{
parse_opt_subcommand_fn *fn = NULL;
struct option builtin_hook_options[] = {
argc = parse_options(argc, argv, NULL, builtin_hook_options,
builtin_hook_usage, 0);
- return fn(argc, argv, prefix);
+ return fn(argc, argv, prefix, repo);
}
}
static int cmd_multi_pack_index_write(int argc, const char **argv,
- const char *prefix)
+ const char *prefix,
+ struct repository *repo UNUSED)
{
struct option *options;
static struct option builtin_multi_pack_index_write_options[] = {
}
static int cmd_multi_pack_index_verify(int argc, const char **argv,
- const char *prefix)
+ const char *prefix,
+ struct repository *repo UNUSED)
{
struct option *options;
static struct option builtin_multi_pack_index_verify_options[] = {
}
static int cmd_multi_pack_index_expire(int argc, const char **argv,
- const char *prefix)
+ const char *prefix,
+ struct repository *repo UNUSED)
{
struct option *options;
static struct option builtin_multi_pack_index_expire_options[] = {
}
static int cmd_multi_pack_index_repack(int argc, const char **argv,
- const char *prefix)
+ const char *prefix,
+ struct repository *repo UNUSED)
{
struct option *options;
static struct option builtin_multi_pack_index_repack_options[] = {
int cmd_multi_pack_index(int argc,
const char **argv,
const char *prefix,
- struct repository *repo UNUSED)
+ struct repository *repo)
{
int res;
parse_opt_subcommand_fn *fn = NULL;
builtin_multi_pack_index_usage, 0);
FREE_AND_NULL(options);
- res = fn(argc, argv, prefix);
+ res = fn(argc, argv, prefix, repo);
free(opts.object_dir);
return res;
return t;
}
-static int list(int argc, const char **argv, const char *prefix)
+static int list(int argc, const char **argv, const char *prefix,
+ struct repository *repo UNUSED)
{
struct notes_tree *t;
struct object_id object;
return retval;
}
-static int append_edit(int argc, const char **argv, const char *prefix);
+static int append_edit(int argc, const char **argv, const char *prefix,
+ struct repository *repo UNUSED);
-static int add(int argc, const char **argv, const char *prefix)
+static int add(int argc, const char **argv, const char *prefix,
+ struct repository *repo)
{
int force = 0, allow_empty = 0;
const char *object_ref;
* argv[0-1].
*/
argv[0] = "edit";
- return append_edit(argc, argv, prefix);
+ return append_edit(argc, argv, prefix, repo);
}
fprintf(stderr, _("Overwriting existing notes for object %s\n"),
oid_to_hex(&object));
return 0;
}
-static int copy(int argc, const char **argv, const char *prefix)
+static int copy(int argc, const char **argv, const char *prefix,
+ struct repository *repo UNUSED)
{
int retval = 0, force = 0, from_stdin = 0;
const struct object_id *from_note, *note;
return retval;
}
-static int append_edit(int argc, const char **argv, const char *prefix)
+static int append_edit(int argc, const char **argv, const char *prefix,
+ struct repository *repo UNUSED)
{
int allow_empty = 0;
const char *object_ref;
return 0;
}
-static int show(int argc, const char **argv, const char *prefix)
+static int show(int argc, const char **argv, const char *prefix,
+ struct repository *repo UNUSED)
{
const char *object_ref;
struct notes_tree *t;
return 0;
}
-static int merge(int argc, const char **argv, const char *prefix)
+static int merge(int argc, const char **argv, const char *prefix,
+ struct repository *repo UNUSED)
{
struct strbuf remote_ref = STRBUF_INIT, msg = STRBUF_INIT;
struct object_id result_oid;
return (flag & IGNORE_MISSING) ? 0 : status;
}
-static int remove_cmd(int argc, const char **argv, const char *prefix)
+static int remove_cmd(int argc, const char **argv, const char *prefix,
+ struct repository *repo UNUSED)
{
unsigned flag = 0;
int from_stdin = 0;
return retval;
}
-static int prune(int argc, const char **argv, const char *prefix)
+static int prune(int argc, const char **argv, const char *prefix,
+ struct repository *repo UNUSED)
{
struct notes_tree *t;
int show_only = 0, verbose = 0;
return 0;
}
-static int get_ref(int argc, const char **argv, const char *prefix)
+static int get_ref(int argc, const char **argv, const char *prefix,
+ struct repository *repo UNUSED)
{
struct option options[] = { OPT_END() };
char *notes_ref;
int cmd_notes(int argc,
const char **argv,
const char *prefix,
- struct repository *repo UNUSED)
+ struct repository *repo)
{
const char *override_notes_ref = NULL;
parse_opt_subcommand_fn *fn = NULL;
strbuf_release(&sb);
}
- return !!fn(argc, argv, prefix);
+ return !!fn(argc, argv, prefix, repo);
}
return 0;
}
-static int cmd_reflog_show(int argc, const char **argv, const char *prefix)
+static int cmd_reflog_show(int argc, const char **argv, const char *prefix,
+ struct repository *repo UNUSED)
{
struct option options[] = {
OPT_END()
return 0;
}
-static int cmd_reflog_list(int argc, const char **argv, const char *prefix)
+static int cmd_reflog_list(int argc, const char **argv, const char *prefix,
+ struct repository *repo UNUSED)
{
struct option options[] = {
OPT_END()
return refs_for_each_reflog(ref_store, show_reflog, NULL);
}
-static int cmd_reflog_expire(int argc, const char **argv, const char *prefix)
+static int cmd_reflog_expire(int argc, const char **argv, const char *prefix,
+ struct repository *repo UNUSED)
{
struct cmd_reflog_expire_cb cmd = { 0 };
timestamp_t now = time(NULL);
return status;
}
-static int cmd_reflog_delete(int argc, const char **argv, const char *prefix)
+static int cmd_reflog_delete(int argc, const char **argv, const char *prefix,
+ struct repository *repo UNUSED)
{
int i, status = 0;
unsigned int flags = 0;
return status;
}
-static int cmd_reflog_exists(int argc, const char **argv, const char *prefix)
+static int cmd_reflog_exists(int argc, const char **argv, const char *prefix,
+ struct repository *repo UNUSED)
{
struct option options[] = {
OPT_END()
PARSE_OPT_KEEP_DASHDASH | PARSE_OPT_KEEP_ARGV0 |
PARSE_OPT_KEEP_UNKNOWN_OPT);
if (fn)
- return fn(argc - 1, argv + 1, prefix);
+ return fn(argc - 1, argv + 1, prefix, repository);
else
return cmd_log_reflog(argc, argv, prefix, repository);
}
#define REFS_VERIFY_USAGE \
N_("git refs verify [--strict] [--verbose]")
-static int cmd_refs_migrate(int argc, const char **argv, const char *prefix)
+static int cmd_refs_migrate(int argc, const char **argv, const char *prefix,
+ struct repository *repo UNUSED)
{
const char * const migrate_usage[] = {
REFS_MIGRATE_USAGE,
return err;
}
-static int cmd_refs_verify(int argc, const char **argv, const char *prefix)
+static int cmd_refs_verify(int argc, const char **argv, const char *prefix,
+ struct repository *repo UNUSED)
{
struct fsck_options fsck_refs_options = FSCK_REFS_OPTIONS_DEFAULT;
const char * const verify_usage[] = {
int cmd_refs(int argc,
const char **argv,
const char *prefix,
- struct repository *repo UNUSED)
+ struct repository *repo)
{
const char * const refs_usage[] = {
REFS_MIGRATE_USAGE,
};
argc = parse_options(argc, argv, prefix, opts, refs_usage, 0);
- return fn(argc, argv, prefix);
+ return fn(argc, argv, prefix, repo);
}
return 0;
}
-static int add(int argc, const char **argv, const char *prefix)
+static int add(int argc, const char **argv, const char *prefix,
+ struct repository *repo UNUSED)
{
int fetch = 0, fetch_tags = TAGS_DEFAULT;
unsigned mirror = MIRROR_NONE;
}
-static int mv(int argc, const char **argv, const char *prefix)
+static int mv(int argc, const char **argv, const char *prefix,
+ struct repository *repo UNUSED)
{
int show_progress = isatty(2);
struct option options[] = {
return result;
}
-static int rm(int argc, const char **argv, const char *prefix)
+static int rm(int argc, const char **argv, const char *prefix,
+ struct repository *repo UNUSED)
{
struct option options[] = {
OPT_END()
return result;
}
-static int show(int argc, const char **argv, const char *prefix)
+static int show(int argc, const char **argv, const char *prefix,
+ struct repository *repo UNUSED)
{
int no_query = 0, result = 0, query_flag = 0;
struct option options[] = {
return result;
}
-static int set_head(int argc, const char **argv, const char *prefix)
+static int set_head(int argc, const char **argv, const char *prefix,
+ struct repository *repo UNUSED)
{
int i, opt_a = 0, opt_d = 0, result = 0;
struct strbuf buf = STRBUF_INIT, buf2 = STRBUF_INIT;
return result;
}
-static int prune(int argc, const char **argv, const char *prefix)
+static int prune(int argc, const char **argv, const char *prefix,
+ struct repository *repo UNUSED)
{
int dry_run = 0, result = 0;
struct option options[] = {
return 0;
}
-static int update(int argc, const char **argv, const char *prefix)
+static int update(int argc, const char **argv, const char *prefix,
+ struct repository *repo UNUSED)
{
int i, prune = -1;
struct option options[] = {
return 0;
}
-static int set_branches(int argc, const char **argv, const char *prefix)
+static int set_branches(int argc, const char **argv, const char *prefix,
+ struct repository *repo UNUSED)
{
int add_mode = 0;
struct option options[] = {
return set_remote_branches(argv[0], argv + 1, add_mode);
}
-static int get_url(int argc, const char **argv, const char *prefix)
+static int get_url(int argc, const char **argv, const char *prefix,
+ struct repository *repo UNUSED)
{
int i, push_mode = 0, all_mode = 0;
const char *remotename = NULL;
return 0;
}
-static int set_url(int argc, const char **argv, const char *prefix)
+static int set_url(int argc, const char **argv, const char *prefix,
+ struct repository *repo UNUSED)
{
int i, push_mode = 0, add_mode = 0, delete_mode = 0;
int matches = 0, negative_matches = 0;
int cmd_remote(int argc,
const char **argv,
const char *prefix,
- struct repository *repo UNUSED)
+ struct repository *repo)
{
parse_opt_subcommand_fn *fn = NULL;
struct option options[] = {
PARSE_OPT_SUBCOMMAND_OPTIONAL);
if (fn) {
- return !!fn(argc, argv, prefix);
+ return !!fn(argc, argv, prefix, repo);
} else {
if (argc) {
error(_("unknown subcommand: `%s'"), argv[0]);
NULL
};
-static int sparse_checkout_list(int argc, const char **argv, const char *prefix)
+static int sparse_checkout_list(int argc, const char **argv, const char *prefix,
+ struct repository *repo UNUSED)
{
static struct option builtin_sparse_checkout_list_options[] = {
OPT_END(),
int sparse_index;
} init_opts;
-static int sparse_checkout_init(int argc, const char **argv, const char *prefix)
+static int sparse_checkout_init(int argc, const char **argv, const char *prefix,
+ struct repository *repo UNUSED)
{
struct pattern_list pl;
char *sparse_filename;
int use_stdin;
} add_opts;
-static int sparse_checkout_add(int argc, const char **argv, const char *prefix)
+static int sparse_checkout_add(int argc, const char **argv, const char *prefix,
+ struct repository *repo UNUSED)
{
static struct option builtin_sparse_checkout_add_options[] = {
OPT_BOOL_F(0, "skip-checks", &add_opts.skip_checks,
int use_stdin;
} set_opts;
-static int sparse_checkout_set(int argc, const char **argv, const char *prefix)
+static int sparse_checkout_set(int argc, const char **argv, const char *prefix,
+ struct repository *repo UNUSED)
{
int default_patterns_nr = 2;
const char *default_patterns[] = {"/*", "!/*/", NULL};
} reapply_opts;
static int sparse_checkout_reapply(int argc, const char **argv,
- const char *prefix)
+ const char *prefix,
+ struct repository *repo UNUSED)
{
static struct option builtin_sparse_checkout_reapply_options[] = {
OPT_BOOL(0, "cone", &reapply_opts.cone_mode,
};
static int sparse_checkout_disable(int argc, const char **argv,
- const char *prefix)
+ const char *prefix,
+ struct repository *repo UNUSED)
{
static struct option builtin_sparse_checkout_disable_options[] = {
OPT_END(),
return 0;
}
-static int sparse_checkout_check_rules(int argc, const char **argv, const char *prefix)
+static int sparse_checkout_check_rules(int argc, const char **argv, const char *prefix,
+ struct repository *repo UNUSED)
{
static struct option builtin_sparse_checkout_check_rules_options[] = {
OPT_BOOL('z', NULL, &check_rules_opts.null_termination,
int cmd_sparse_checkout(int argc,
const char **argv,
const char *prefix,
- struct repository *repo UNUSED)
+ struct repository *repo)
{
parse_opt_subcommand_fn *fn = NULL;
struct option builtin_sparse_checkout_options[] = {
prepare_repo_settings(the_repository);
the_repository->settings.command_requires_full_index = 0;
- return fn(argc, argv, prefix);
+ return fn(argc, argv, prefix, repo);
}
ref_stash, &obj, 0);
}
-static int clear_stash(int argc, const char **argv, const char *prefix)
+static int clear_stash(int argc, const char **argv, const char *prefix,
+ struct repository *repo UNUSED)
{
struct option options[] = {
OPT_END()
return ret;
}
-static int apply_stash(int argc, const char **argv, const char *prefix)
+static int apply_stash(int argc, const char **argv, const char *prefix,
+ struct repository *repo UNUSED)
{
int ret = -1;
int quiet = 0;
return 0;
}
-static int drop_stash(int argc, const char **argv, const char *prefix)
+static int drop_stash(int argc, const char **argv, const char *prefix,
+ struct repository *repo UNUSED)
{
int ret = -1;
int quiet = 0;
return ret;
}
-static int pop_stash(int argc, const char **argv, const char *prefix)
+static int pop_stash(int argc, const char **argv, const char *prefix,
+ struct repository *repo UNUSED)
{
int ret = -1;
int index = 0;
return ret;
}
-static int branch_stash(int argc, const char **argv, const char *prefix)
+static int branch_stash(int argc, const char **argv, const char *prefix,
+ struct repository *repo UNUSED)
{
int ret = -1;
const char *branch = NULL;
return ret;
}
-static int list_stash(int argc, const char **argv, const char *prefix)
+static int list_stash(int argc, const char **argv, const char *prefix,
+ struct repository *repo UNUSED)
{
struct child_process cp = CHILD_PROCESS_INIT;
struct option options[] = {
do_diff_cache(&info->b_commit, diff_opt);
}
-static int show_stash(int argc, const char **argv, const char *prefix)
+static int show_stash(int argc, const char **argv, const char *prefix,
+ struct repository *repo UNUSED)
{
int i;
int ret = -1;
return 0;
}
-static int store_stash(int argc, const char **argv, const char *prefix)
+static int store_stash(int argc, const char **argv, const char *prefix,
+ struct repository *repo UNUSED)
{
int quiet = 0;
const char *stash_msg = NULL;
return ret;
}
-static int create_stash(int argc, const char **argv, const char *prefix UNUSED)
+static int create_stash(int argc, const char **argv, const char *prefix UNUSED,
+ struct repository *repo UNUSED)
{
int ret;
struct strbuf stash_msg_buf = STRBUF_INIT;
return ret;
}
-static int push_stash_unassumed(int argc, const char **argv, const char *prefix)
+static int push_stash_unassumed(int argc, const char **argv, const char *prefix,
+ struct repository *repo UNUSED)
{
return push_stash(argc, argv, prefix, 0);
}
-static int save_stash(int argc, const char **argv, const char *prefix)
+static int save_stash(int argc, const char **argv, const char *prefix,
+ struct repository *repo UNUSED)
{
int keep_index = -1;
int only_staged = 0;
int cmd_stash(int argc,
const char **argv,
const char *prefix,
- struct repository *repo UNUSED)
+ struct repository *repo)
{
pid_t pid = getpid();
const char *index_file;
(uintmax_t)pid);
if (fn)
- return !!fn(argc, argv, prefix);
+ return !!fn(argc, argv, prefix, repo);
else if (!argc)
- return !!push_stash_unassumed(0, NULL, prefix);
+ return !!push_stash_unassumed(0, NULL, prefix, repo);
/* Assume 'stash push' */
strvec_push(&args, "push");
free(displaypath);
}
-static int module_foreach(int argc, const char **argv, const char *prefix)
+static int module_foreach(int argc, const char **argv, const char *prefix,
+ struct repository *repo UNUSED)
{
struct foreach_cb info = FOREACH_CB_INIT;
struct pathspec pathspec = { 0 };
info->flags);
}
-static int module_init(int argc, const char **argv, const char *prefix)
+static int module_init(int argc, const char **argv, const char *prefix,
+ struct repository *repo UNUSED)
{
struct init_cb info = INIT_CB_INIT;
struct pathspec pathspec = { 0 };
info->prefix, info->super_prefix, info->flags);
}
-static int module_status(int argc, const char **argv, const char *prefix)
+static int module_status(int argc, const char **argv, const char *prefix,
+ struct repository *repo UNUSED)
{
struct status_cb info = STATUS_CB_INIT;
struct pathspec pathspec = { 0 };
return ret;
}
-static int module_summary(int argc, const char **argv, const char *prefix)
+static int module_summary(int argc, const char **argv, const char *prefix,
+ struct repository *repo UNUSED)
{
struct summary_cb info = SUMMARY_CB_INIT;
int cached = 0;
info->flags);
}
-static int module_sync(int argc, const char **argv, const char *prefix)
+static int module_sync(int argc, const char **argv, const char *prefix,
+ struct repository *repo UNUSED)
{
struct sync_cb info = SYNC_CB_INIT;
struct pathspec pathspec = { 0 };
deinit_submodule(list_item->name, info->prefix, info->flags);
}
-static int module_deinit(int argc, const char **argv, const char *prefix)
+static int module_deinit(int argc, const char **argv, const char *prefix,
+ struct repository *repo UNUSED)
{
struct deinit_cb info = DEINIT_CB_INIT;
struct pathspec pathspec = { 0 };
return 0;
}
-static int module_clone(int argc, const char **argv, const char *prefix)
+static int module_clone(int argc, const char **argv, const char *prefix,
+ struct repository *repo UNUSED)
{
int dissociate = 0, quiet = 0, progress = 0, require_init = 0;
struct module_clone_data clone_data = MODULE_CLONE_DATA_INIT;
return ret;
}
-static int module_update(int argc, const char **argv, const char *prefix)
+static int module_update(int argc, const char **argv, const char *prefix,
+ struct repository *repo UNUSED)
{
struct pathspec pathspec = { 0 };
struct pathspec pathspec2 = { 0 };
return ret;
}
-static int push_check(int argc, const char **argv, const char *prefix UNUSED)
+static int push_check(int argc, const char **argv, const char *prefix UNUSED,
+ struct repository *repo UNUSED)
{
struct remote *remote;
const char *superproject_head;
return 0;
}
-static int absorb_git_dirs(int argc, const char **argv, const char *prefix)
+static int absorb_git_dirs(int argc, const char **argv, const char *prefix,
+ struct repository *repo UNUSED)
{
int i;
struct pathspec pathspec = { 0 };
return ret;
}
-static int module_set_url(int argc, const char **argv, const char *prefix)
+static int module_set_url(int argc, const char **argv, const char *prefix,
+ struct repository *repo UNUSED)
{
int quiet = 0, ret;
const char *newurl;
return !!ret;
}
-static int module_set_branch(int argc, const char **argv, const char *prefix)
+static int module_set_branch(int argc, const char **argv, const char *prefix,
+ struct repository *repo UNUSED)
{
int opt_default = 0, ret;
const char *opt_branch = NULL;
return !!ret;
}
-static int module_create_branch(int argc, const char **argv, const char *prefix)
+static int module_create_branch(int argc, const char **argv, const char *prefix,
+ struct repository *repo UNUSED)
{
enum branch_track track;
int quiet = 0, force = 0, reflog = 0, dry_run = 0;
strbuf_release(&sb);
}
-static int module_add(int argc, const char **argv, const char *prefix)
+static int module_add(int argc, const char **argv, const char *prefix,
+ struct repository *repo UNUSED)
{
int force = 0, quiet = 0, progress = 0, dissociate = 0;
struct add_data add_data = ADD_DATA_INIT;
int cmd_submodule__helper(int argc,
const char **argv,
const char *prefix,
- struct repository *repo UNUSED)
+ struct repository *repo)
{
parse_opt_subcommand_fn *fn = NULL;
const char *const usage[] = {
};
argc = parse_options(argc, argv, prefix, options, usage, 0);
- return fn(argc, argv, prefix);
+ return fn(argc, argv, prefix, repo);
}
strbuf_release(&reason);
}
-static int prune(int ac, const char **av, const char *prefix)
+static int prune(int ac, const char **av, const char *prefix,
+ struct repository *repo UNUSED)
{
struct option options[] = {
OPT__DRY_RUN(&show_only, N_("do not remove, show only")),
return NULL;
}
-static int add(int ac, const char **av, const char *prefix)
+static int add(int ac, const char **av, const char *prefix,
+ struct repository *repo UNUSED)
{
struct add_opts opts;
const char *new_branch_force = NULL;
QSORT(wt, n, pathcmp);
}
-static int list(int ac, const char **av, const char *prefix)
+static int list(int ac, const char **av, const char *prefix,
+ struct repository *repo UNUSED)
{
int porcelain = 0;
int line_terminator = '\n';
return 0;
}
-static int lock_worktree(int ac, const char **av, const char *prefix)
+static int lock_worktree(int ac, const char **av, const char *prefix,
+ struct repository *repo UNUSED)
{
const char *reason = "", *old_reason;
struct option options[] = {
return 0;
}
-static int unlock_worktree(int ac, const char **av, const char *prefix)
+static int unlock_worktree(int ac, const char **av, const char *prefix,
+ struct repository *repo UNUSED)
{
struct option options[] = {
OPT_END()
die(_("working trees containing submodules cannot be moved or removed"));
}
-static int move_worktree(int ac, const char **av, const char *prefix)
+static int move_worktree(int ac, const char **av, const char *prefix,
+ struct repository *repo UNUSED)
{
int force = 0;
struct option options[] = {
return ret;
}
-static int remove_worktree(int ac, const char **av, const char *prefix)
+static int remove_worktree(int ac, const char **av, const char *prefix,
+ struct repository *repo UNUSED)
{
int force = 0;
struct option options[] = {
}
}
-static int repair(int ac, const char **av, const char *prefix)
+static int repair(int ac, const char **av, const char *prefix,
+ struct repository *repo UNUSED)
{
const char **p;
const char *self[] = { ".", NULL };
int cmd_worktree(int ac,
const char **av,
const char *prefix,
- struct repository *repo UNUSED)
+ struct repository *repo)
{
parse_opt_subcommand_fn *fn = NULL;
struct option options[] = {
prepare_repo_settings(the_repository);
the_repository->settings.command_requires_full_index = 0;
- return fn(ac, av, prefix);
+ return fn(ac, av, prefix, repo);
}
#include "gettext.h"
+struct repository;
+
/**
* Refer to Documentation/technical/api-parse-options.txt for the API doc.
*/
const char *arg, int unset);
typedef int parse_opt_subcommand_fn(int argc, const char **argv,
- const char *prefix);
+ const char *prefix, struct repository *repo);
/*
* `type`::
return parse_options_flags__cmd(argc, argv, test_flags);
}
-static int subcmd_one(int argc, const char **argv, const char *prefix UNUSED)
+static int subcmd_one(int argc, const char **argv, const char *prefix UNUSED,
+ struct repository *repo UNUSED)
{
printf("fn: subcmd_one\n");
print_args(argc, argv);
return 0;
}
-static int subcmd_two(int argc, const char **argv, const char *prefix UNUSED)
+static int subcmd_two(int argc, const char **argv, const char *prefix UNUSED,
+ struct repository *repo UNUSED)
{
printf("fn: subcmd_two\n");
print_args(argc, argv);
printf("opt: %d\n", opt);
- return fn(argc, argv, NULL);
+ return fn(argc, argv, NULL, NULL);
}
int cmd__parse_subcommand(int argc, const char **argv)