rebase: move parse_opt_keep_empty() down
This moves it right next to parse_opt_empty(), which is a much more logical place. As a side effect, this removes the need for a forward declaration of imply_merge(). Signed-off-by: Oswald Buddenhagen <oswald.buddenhagen@gmx.de> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Oswald Buddenhagen committed
Oct 20, 2023 at 11:36 UTC
96db17352d8821ceb99dd9e1c19bd74d680effb7
1 file changed
+12
-13
builtin/rebase.c
+12
-13
@@ -376,19 +376,6 @@ static int run_sequencer_rebase(struct rebase_options *opts)
376
return ret;
377
}
378
379
-static void imply_merge(struct rebase_options *opts, const char *option);
380
-static int parse_opt_keep_empty(const struct option *opt, const char *arg,
381
- int unset)
382
-{
383
- struct rebase_options *opts = opt->value;
384
-
385
- BUG_ON_OPT_ARG(arg);
386
-
387
- imply_merge(opts, unset ? "--no-keep-empty" : "--keep-empty");
388
- opts->keep_empty = !unset;
389
- return 0;
390
-}
391
-
379
static int is_merge(struct rebase_options *opts)
380
{
381
return opts->type == REBASE_MERGE;
@@ -982,6 +969,18 @@ static enum empty_type parse_empty_value(const char *value)
969
die(_("unrecognized empty type '%s'; valid values are \"drop\", \"keep\", and \"ask\"."), value);
970
}
971
972
+static int parse_opt_keep_empty(const struct option *opt, const char *arg,
973
+ int unset)
974
+{
975
+ struct rebase_options *opts = opt->value;
976
+
977
+ BUG_ON_OPT_ARG(arg);
978
+
979
+ imply_merge(opts, unset ? "--no-keep-empty" : "--keep-empty");
980
+ opts->keep_empty = !unset;
981
+ return 0;
982
+}
983
+
984
static int parse_opt_empty(const struct option *opt, const char *arg, int unset)
985
{
986
struct rebase_options *options = opt->value;