From bbcde41a70a7e0264c214896aac84d1ec3fdcbf6 Mon Sep 17 00:00:00 2001 From: Matthew DeVore Date: Mon, 3 Dec 2018 14:10:19 -0800 Subject: revision.c: put promisor option in specialized struct Put the allow_exclude_promisor_objects flag in setup_revision_opt. When it was in rev_info, it was unclear when it was used, since rev_info is passed to functions that don't use the flag. This resulted in unnecessary setting of the flag in prune.c, so fix that as well. Signed-off-by: Matthew DeVore Signed-off-by: Junio C Hamano --- builtin/pack-objects.c | 6 ++++-- builtin/prune.c | 1 - builtin/rev-list.c | 6 ++++-- 3 files changed, 8 insertions(+), 5 deletions(-) (limited to 'builtin') diff --git a/builtin/pack-objects.c b/builtin/pack-objects.c index 8ac8ca1d26..4408807e62 100644 --- a/builtin/pack-objects.c +++ b/builtin/pack-objects.c @@ -2848,13 +2848,15 @@ static void record_recent_commit(struct commit *commit, void *data) static void get_object_list(int ac, const char **av) { struct rev_info revs; + struct setup_revision_opt s_r_opt = { + .allow_exclude_promisor_objects = 1, + }; char line[1000]; int flags = 0; init_revisions(&revs, NULL); save_commit_buffer = 0; - revs.allow_exclude_promisor_objects_opt = 1; - setup_revisions(ac, av, &revs, NULL); + setup_revisions(ac, av, &revs, &s_r_opt); /* make sure shallows are read */ is_repository_shallow(); diff --git a/builtin/prune.c b/builtin/prune.c index a5c784749e..4394d01c93 100644 --- a/builtin/prune.c +++ b/builtin/prune.c @@ -118,7 +118,6 @@ int cmd_prune(int argc, const char **argv, const char *prefix) save_commit_buffer = 0; check_replace_refs = 0; ref_paranoia = 1; - revs.allow_exclude_promisor_objects_opt = 1; init_revisions(&revs, prefix); argc = parse_options(argc, argv, prefix, options, prune_usage, 0); diff --git a/builtin/rev-list.c b/builtin/rev-list.c index c8f3ac8d09..807a50a2fb 100644 --- a/builtin/rev-list.c +++ b/builtin/rev-list.c @@ -357,6 +357,9 @@ int cmd_rev_list(int argc, const char **argv, const char *prefix) { struct rev_info revs; struct rev_list_info info; + struct setup_revision_opt s_r_opt = { + .allow_exclude_promisor_objects = 1, + }; int i; int bisect_list = 0; int bisect_show_vars = 0; @@ -370,7 +373,6 @@ int cmd_rev_list(int argc, const char **argv, const char *prefix) git_config(git_default_config, NULL); init_revisions(&revs, prefix); revs.abbrev = DEFAULT_ABBREV; - revs.allow_exclude_promisor_objects_opt = 1; revs.commit_format = CMIT_FMT_UNSPECIFIED; /* @@ -401,7 +403,7 @@ int cmd_rev_list(int argc, const char **argv, const char *prefix) } } - argc = setup_revisions(argc, argv, &revs, NULL); + argc = setup_revisions(argc, argv, &revs, &s_r_opt); memset(&info, 0, sizeof(info)); info.revs = &revs; -- cgit v1.2.3