summaryrefslogtreecommitdiff
path: root/builtin
diff options
context:
space:
mode:
authorLibravatar Liam Beguin <liambeguin@gmail.com>2017-12-05 12:52:32 -0500
committerLibravatar Junio C Hamano <gitster@pobox.com>2017-12-05 10:20:51 -0800
commit313a48eaca58ecd170bef9e6a5a55001c7511f08 (patch)
tree11574a33a7c05498d764cde69a6406e7e130ff40 /builtin
parentrebase -i: replace reference to sha1 with oid (diff)
downloadtgif-313a48eaca58ecd170bef9e6a5a55001c7511f08.tar.xz
rebase -i: update functions to use a flags parameter
Update functions used in the rebase--helper so that they take a generic 'flags' parameter instead of a growing list of options. Signed-off-by: Liam Beguin <liambeguin@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'builtin')
-rw-r--r--builtin/rebase--helper.c13
1 files changed, 7 insertions, 6 deletions
diff --git a/builtin/rebase--helper.c b/builtin/rebase--helper.c
index c3b8e4d401..1102ecb43b 100644
--- a/builtin/rebase--helper.c
+++ b/builtin/rebase--helper.c
@@ -12,7 +12,7 @@ static const char * const builtin_rebase_helper_usage[] = {
int cmd_rebase__helper(int argc, const char **argv, const char *prefix)
{
struct replay_opts opts = REPLAY_OPTS_INIT;
- int keep_empty = 0;
+ unsigned flags = 0, keep_empty = 0;
enum {
CONTINUE = 1, ABORT, MAKE_SCRIPT, SHORTEN_OIDS, EXPAND_OIDS,
CHECK_TODO_LIST, SKIP_UNNECESSARY_PICKS, REARRANGE_SQUASH
@@ -48,16 +48,17 @@ int cmd_rebase__helper(int argc, const char **argv, const char *prefix)
argc = parse_options(argc, argv, NULL, options,
builtin_rebase_helper_usage, PARSE_OPT_KEEP_ARGV0);
+ flags |= keep_empty ? TODO_LIST_KEEP_EMPTY : 0;
+ flags |= command == SHORTEN_OIDS ? TODO_LIST_SHORTEN_IDS : 0;
+
if (command == CONTINUE && argc == 1)
return !!sequencer_continue(&opts);
if (command == ABORT && argc == 1)
return !!sequencer_remove_state(&opts);
if (command == MAKE_SCRIPT && argc > 1)
- return !!sequencer_make_script(keep_empty, stdout, argc, argv);
- if (command == SHORTEN_OIDS && argc == 1)
- return !!transform_todos(1);
- if (command == EXPAND_OIDS && argc == 1)
- return !!transform_todos(0);
+ return !!sequencer_make_script(stdout, argc, argv, flags);
+ if ((command == SHORTEN_OIDS || command == EXPAND_OIDS) && argc == 1)
+ return !!transform_todos(flags);
if (command == CHECK_TODO_LIST && argc == 1)
return !!check_todo_list();
if (command == SKIP_UNNECESSARY_PICKS && argc == 1)