summaryrefslogtreecommitdiff
path: root/builtin/am.c
diff options
context:
space:
mode:
authorPaul Tan <pyokagan@gmail.com>2015-08-04 13:51:51 (GMT)
committerJunio C Hamano <gitster@pobox.com>2015-08-05 05:02:11 (GMT)
commitf07adb62f292eec0d10fd10b0812800afb03363c (patch)
tree8d946cd504c4841e086dde954f11e24c785f5690 /builtin/am.c
parent257e8cecc13b323c7b5c3fb249955b3ee8f4af3d (diff)
downloadgit-f07adb62f292eec0d10fd10b0812800afb03363c.zip
git-f07adb62f292eec0d10fd10b0812800afb03363c.tar.gz
git-f07adb62f292eec0d10fd10b0812800afb03363c.tar.bz2
builtin-am: implement --ignore-date
Since a79ec62 (git-am: Add --ignore-date option, 2009-01-24), git-am.sh supported the --ignore-date option, and would use the current timestamp instead of the one provided in the patch if the option was set. Re-implement this option in builtin/am.c. Signed-off-by: Paul Tan <pyokagan@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'builtin/am.c')
-rw-r--r--builtin/am.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/builtin/am.c b/builtin/am.c
index f842f69..84d3e05 100644
--- a/builtin/am.c
+++ b/builtin/am.c
@@ -108,6 +108,7 @@ struct am_state {
int scissors; /* enum scissors_type */
struct argv_array git_apply_opts;
const char *resolvemsg;
+ int ignore_date;
int rebasing;
};
@@ -1217,7 +1218,8 @@ static void do_commit(const struct am_state *state)
}
author = fmt_ident(state->author_name, state->author_email,
- state->author_date, IDENT_STRICT);
+ state->ignore_date ? NULL : state->author_date,
+ IDENT_STRICT);
if (commit_tree(state->msg, state->msg_len, tree, parents, commit,
author, NULL))
@@ -1661,6 +1663,8 @@ int cmd_am(int argc, const char **argv, const char *prefix)
OPT_CMDMODE(0, "abort", &resume,
N_("restore the original branch and abort the patching operation."),
RESUME_ABORT),
+ OPT_BOOL(0, "ignore-date", &state.ignore_date,
+ N_("use current timestamp for author date")),
OPT_HIDDEN_BOOL(0, "rebasing", &state.rebasing,
N_("(internal use for git-rebase)")),
OPT_END()