diff options
author | Junio C Hamano <gitster@pobox.com> | 2018-02-28 22:37:52 +0100 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2018-02-28 22:37:52 +0100 |
commit | c22c624a9de3576d6e66f81c3a1edc6dfcfb08bb (patch) | |
tree | 0f8bdd53d9cad7b369c0e120cdff23bff40bdd27 /builtin/am.c | |
parent | Fifth batch for 2.17 (diff) | |
parent | am: support --quit (diff) | |
download | git-c22c624a9de3576d6e66f81c3a1edc6dfcfb08bb.tar.xz git-c22c624a9de3576d6e66f81c3a1edc6dfcfb08bb.zip |
Merge branch 'nd/am-quit'
"git am" has learned the "--quit" option, in addition to the existing
"--abort" option; having the pair mirrors a few other commands like
"rebase" and "cherry-pick".
* nd/am-quit:
am: support --quit
Diffstat (limited to 'builtin/am.c')
-rw-r--r-- | builtin/am.c | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/builtin/am.c b/builtin/am.c index 6661edc162..05a82f4aa5 100644 --- a/builtin/am.c +++ b/builtin/am.c @@ -2149,7 +2149,8 @@ enum resume_mode { RESUME_APPLY, RESUME_RESOLVED, RESUME_SKIP, - RESUME_ABORT + RESUME_ABORT, + RESUME_QUIT }; static int git_am_config(const char *k, const char *v, void *cb) @@ -2249,6 +2250,9 @@ 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_CMDMODE(0, "quit", &resume, + N_("abort the patching operation but keep HEAD where it is."), + RESUME_QUIT), OPT_BOOL(0, "committer-date-is-author-date", &state.committer_date_is_author_date, N_("lie about committer date")), @@ -2317,7 +2321,7 @@ int cmd_am(int argc, const char **argv, const char *prefix) * stray directories. */ if (file_exists(state.dir) && !state.rebasing) { - if (resume == RESUME_ABORT) { + if (resume == RESUME_ABORT || resume == RESUME_QUIT) { am_destroy(&state); am_state_release(&state); return 0; @@ -2359,6 +2363,10 @@ int cmd_am(int argc, const char **argv, const char *prefix) case RESUME_ABORT: am_abort(&state); break; + case RESUME_QUIT: + am_rerere_clear(); + am_destroy(&state); + break; default: die("BUG: invalid resume value"); } |