diff options
Diffstat (limited to 'builtin')
-rw-r--r-- | builtin/rebase.c | 13 |
1 files changed, 8 insertions, 5 deletions
diff --git a/builtin/rebase.c b/builtin/rebase.c index 2579380729..583ac96fc7 100644 --- a/builtin/rebase.c +++ b/builtin/rebase.c @@ -89,6 +89,7 @@ struct rebase_options { char *gpg_sign_opt; int autostash; int committer_date_is_author_date; + int ignore_date; char *cmd; int allow_empty_message; int rebase_merges, rebase_cousins; @@ -127,6 +128,7 @@ static struct replay_opts get_replay_opts(const struct rebase_options *opts) replay.reschedule_failed_exec = opts->reschedule_failed_exec; replay.committer_date_is_author_date = opts->committer_date_is_author_date; + replay.ignore_date = opts->ignore_date; replay.gpg_sign = xstrdup_or_null(opts->gpg_sign_opt); replay.strategy = opts->strategy; @@ -1503,8 +1505,8 @@ int cmd_rebase(int argc, const char **argv, const char *prefix) OPT_BOOL(0, "committer-date-is-author-date", &options.committer_date_is_author_date, N_("make committer date match author date")), - OPT_PASSTHRU_ARGV(0, "ignore-date", &options.git_am_opts, NULL, - N_("passed to 'git am'"), PARSE_OPT_NOARG), + OPT_BOOL(0, "ignore-date", &options.ignore_date, + N_("ignore author date and use current date")), OPT_PASSTHRU_ARGV('C', NULL, &options.git_am_opts, N_("n"), N_("passed to 'git apply'"), 0), OPT_BOOL(0, "ignore-whitespace", &ignore_whitespace, @@ -1797,13 +1799,12 @@ int cmd_rebase(int argc, const char **argv, const char *prefix) options.autosquash) { allow_preemptive_ff = 0; } - if (options.committer_date_is_author_date) + if (options.committer_date_is_author_date || options.ignore_date) options.flags |= REBASE_FORCE; for (i = 0; i < options.git_am_opts.argc; i++) { const char *option = options.git_am_opts.argv[i], *p; - if (!strcmp(option, "--ignore-date") || - !strcmp(option, "--whitespace=fix") || + if (!strcmp(option, "--whitespace=fix") || !strcmp(option, "--whitespace=strip")) allow_preemptive_ff = 0; else if (skip_prefix(option, "-C", &p)) { @@ -1862,6 +1863,8 @@ int cmd_rebase(int argc, const char **argv, const char *prefix) if (options.committer_date_is_author_date) argv_array_push(&options.git_am_opts, "--committer-date-is-author-date"); + if (options.ignore_date) + argv_array_push(&options.git_am_opts, "--ignore-date"); } else { /* REBASE_MERGE and PRESERVE_MERGES */ if (ignore_whitespace) { |