die(_("failed to pack objects via path-walk"));
}
-static void get_object_list(struct rev_info *revs, int ac, const char **av)
+static void get_object_list(struct rev_info *revs, struct strvec *argv)
{
struct setup_revision_opt s_r_opt = {
.allow_exclude_promisor_objects = 1,
int save_warning;
save_commit_buffer = 0;
- setup_revisions(ac, av, revs, &s_r_opt);
+ setup_revisions_from_strvec(argv, revs, &s_r_opt);
/* make sure shallows are read */
is_repository_shallow(the_repository);
revs.include_check = is_not_in_promisor_pack;
revs.include_check_obj = is_not_in_promisor_pack_obj;
}
- get_object_list(&revs, rp.nr, rp.v);
+ get_object_list(&revs, &rp);
release_revisions(&revs);
}
cleanup_preferred_base();
oid_to_hex(&opts->restrict_revision->object.oid));
ret = sequencer_make_script(the_repository, &todo_list.buf,
- make_script_args.nr, make_script_args.v,
- flags);
+ &make_script_args, flags);
if (ret) {
error(_("could not generate todo list"));
goto cleanup;
return 0;
}
-int sequencer_make_script(struct repository *r, struct strbuf *out, int argc,
- const char **argv, unsigned flags)
+int sequencer_make_script(struct repository *r, struct strbuf *out,
+ struct strvec *argv, unsigned flags)
{
char *format = NULL;
struct pretty_print_context pp = {0};
pp.fmt = revs.commit_format;
pp.output_encoding = get_log_output_encoding();
- if (setup_revisions(argc, argv, &revs, NULL) > 1) {
+ setup_revisions_from_strvec(argv, &revs, NULL);
+ if (argv->nr > 1) {
ret = error(_("make_script: unhandled options"));
goto cleanup;
}
#define TODO_LIST_REAPPLY_CHERRY_PICKS (1U << 7)
#define TODO_LIST_WARN_SKIPPED_CHERRY_PICKS (1U << 8)
-int sequencer_make_script(struct repository *r, struct strbuf *out, int argc,
- const char **argv, unsigned flags);
+int sequencer_make_script(struct repository *r, struct strbuf *out,
+ struct strvec *argv, unsigned flags);
int complete_action(struct repository *r, struct replay_opts *opts, unsigned flags,
const char *shortrevisions, const char *onto_name,
* are marked with shallow_flag. The list of border/shallow commits
* are also returned.
*/
-struct commit_list *get_shallow_commits_by_rev_list(int ac, const char **av,
+struct commit_list *get_shallow_commits_by_rev_list(struct strvec *argv,
int shallow_flag,
int not_shallow_flag)
{
repo_init_revisions(the_repository, &revs, NULL);
save_commit_buffer = 0;
- setup_revisions(ac, av, &revs, NULL);
+ setup_revisions_from_strvec(argv, &revs, NULL);
if (prepare_revision_walk(&revs))
die("revision walk setup failed");
#include "strbuf.h"
struct oid_array;
+struct strvec;
void set_alternate_shallow_file(struct repository *r, const char *path, int override);
int register_shallow(struct repository *r, const struct object_id *oid);
struct commit_list *get_shallow_commits(struct object_array *heads,
int depth, int shallow_flag, int not_shallow_flag);
-struct commit_list *get_shallow_commits_by_rev_list(
- int ac, const char **av, int shallow_flag, int not_shallow_flag);
+struct commit_list *get_shallow_commits_by_rev_list(struct strvec *argv,
+ int shallow_flag, int not_shallow_flag);
int write_shallow_commits(struct strbuf *out, int use_pack_protocol,
const struct oid_array *extra);
}
static void deepen_by_rev_list(struct upload_pack_data *data,
- int ac,
- const char **av)
+ struct strvec *argv)
{
struct commit_list *result;
disable_commit_graph(the_repository);
- result = get_shallow_commits_by_rev_list(ac, av, SHALLOW, NOT_SHALLOW);
+ result = get_shallow_commits_by_rev_list(argv, SHALLOW, NOT_SHALLOW);
send_shallow(data, result);
free_commit_list(result);
send_unshallow(data);
struct object *o = data->want_obj.objects[i].item;
strvec_push(&av, oid_to_hex(&o->oid));
}
- deepen_by_rev_list(data, av.nr, av.v);
+ deepen_by_rev_list(data, &av);
strvec_clear(&av);
ret = 1;
} else {