aboutsummaryrefslogtreecommitdiffstats
path: root/builtin
diff options
context:
space:
mode:
Diffstat (limited to 'builtin')
-rw-r--r--builtin/describe.c3
-rw-r--r--builtin/pack-objects.c6
-rw-r--r--builtin/rebase.c3
-rw-r--r--builtin/stash.c4
-rw-r--r--builtin/submodule--helper.c10
5 files changed, 16 insertions, 10 deletions
diff --git a/builtin/describe.c b/builtin/describe.c
index ffaf8d9f0a..9f4e26d7ff 100644
--- a/builtin/describe.c
+++ b/builtin/describe.c
@@ -580,8 +580,7 @@ static void describe_blob(const struct object_id *oid, struct strbuf *dst)
NULL);
repo_init_revisions(the_repository, &revs, NULL);
- setup_revisions_from_strvec(&args, &revs, NULL);
- if (args.nr > 1)
+ if (setup_revisions(args.nr, args.v, &revs, NULL) > 1)
BUG("setup_revisions could not handle all args?");
if (prepare_revision_walk(&revs))
diff --git a/builtin/pack-objects.c b/builtin/pack-objects.c
index 5856b5f6bf..1494afcf3d 100644
--- a/builtin/pack-objects.c
+++ b/builtin/pack-objects.c
@@ -4650,7 +4650,7 @@ static void get_object_list_path_walk(struct rev_info *revs)
die(_("failed to pack objects via path-walk"));
}
-static void get_object_list(struct rev_info *revs, struct strvec *argv)
+static void get_object_list(struct rev_info *revs, int ac, const char **av)
{
struct setup_revision_opt s_r_opt = {
.allow_exclude_promisor_objects = 1,
@@ -4660,7 +4660,7 @@ static void get_object_list(struct rev_info *revs, struct strvec *argv)
int save_warning;
save_commit_buffer = 0;
- setup_revisions_from_strvec(argv, revs, &s_r_opt);
+ setup_revisions(ac, av, revs, &s_r_opt);
/* make sure shallows are read */
is_repository_shallow(the_repository);
@@ -5229,7 +5229,7 @@ int cmd_pack_objects(int argc,
revs.include_check = is_not_in_promisor_pack;
revs.include_check_obj = is_not_in_promisor_pack_obj;
}
- get_object_list(&revs, &rp);
+ get_object_list(&revs, rp.nr, rp.v);
release_revisions(&revs);
}
cleanup_preferred_base();
diff --git a/builtin/rebase.c b/builtin/rebase.c
index c468828189..67c0352bf8 100644
--- a/builtin/rebase.c
+++ b/builtin/rebase.c
@@ -299,7 +299,8 @@ static int do_interactive_rebase(struct rebase_options *opts, unsigned flags)
oid_to_hex(&opts->restrict_revision->object.oid));
ret = sequencer_make_script(the_repository, &todo_list.buf,
- &make_script_args, flags);
+ make_script_args.nr, make_script_args.v,
+ flags);
if (ret) {
error(_("could not generate todo list"));
goto cleanup;
diff --git a/builtin/stash.c b/builtin/stash.c
index bea64d04a0..b7db7c8364 100644
--- a/builtin/stash.c
+++ b/builtin/stash.c
@@ -1015,8 +1015,8 @@ static int show_stash(int argc, const char **argv, const char *prefix,
}
}
- setup_revisions_from_strvec(&revision_args, &rev, NULL);
- if (revision_args.nr > 1)
+ argc = setup_revisions(revision_args.nr, revision_args.v, &rev, NULL);
+ if (argc > 1)
goto usage;
if (!rev.diffopt.output_format) {
rev.diffopt.output_format = DIFF_FORMAT_PATCH;
diff --git a/builtin/submodule--helper.c b/builtin/submodule--helper.c
index fcd73abe53..07a1935cbe 100644
--- a/builtin/submodule--helper.c
+++ b/builtin/submodule--helper.c
@@ -616,6 +616,9 @@ static void status_submodule(const char *path, const struct object_id *ce_oid,
struct rev_info rev = REV_INFO_INIT;
struct strbuf buf = STRBUF_INIT;
const char *git_dir;
+ struct setup_revision_opt opt = {
+ .free_removed_argv_elements = 1,
+ };
if (validate_submodule_path(path) < 0)
die(NULL);
@@ -652,7 +655,7 @@ static void status_submodule(const char *path, const struct object_id *ce_oid,
repo_init_revisions(the_repository, &rev, NULL);
rev.abbrev = 0;
- setup_revisions_from_strvec(&diff_files_args, &rev, NULL);
+ setup_revisions(diff_files_args.nr, diff_files_args.v, &rev, &opt);
run_diff_files(&rev, 0);
if (!diff_result_code(&rev)) {
@@ -1091,6 +1094,9 @@ static int compute_summary_module_list(struct object_id *head_oid,
{
struct strvec diff_args = STRVEC_INIT;
struct rev_info rev;
+ struct setup_revision_opt opt = {
+ .free_removed_argv_elements = 1,
+ };
struct module_cb_list list = MODULE_CB_LIST_INIT;
int ret = 0;
@@ -1108,7 +1114,7 @@ static int compute_summary_module_list(struct object_id *head_oid,
repo_init_revisions(the_repository, &rev, info->prefix);
rev.abbrev = 0;
precompose_argv_prefix(diff_args.nr, diff_args.v, NULL);
- setup_revisions_from_strvec(&diff_args, &rev, NULL);
+ setup_revisions(diff_args.nr, diff_args.v, &rev, &opt);
rev.diffopt.output_format = DIFF_FORMAT_NO_OUTPUT | DIFF_FORMAT_CALLBACK;
rev.diffopt.format_callback = submodule_summary_callback;
rev.diffopt.format_callback_data = &list;