]> git.ipfire.org Git - thirdparty/git.git/blobdiff - builtin/am.c
Merge branch 'pb/ref-filter-with-crlf'
[thirdparty/git.git] / builtin / am.c
index 72591864088f5ddd8253aa2ea66503591c183f59..b727449aedac55a683960efb9919656226d92a77 100644 (file)
@@ -161,7 +161,7 @@ static void am_state_init(struct am_state *state)
        state->committer_name =
                xmemdupz(id.name_begin, id.name_end - id.name_begin);
        state->committer_email =
-               xmemdupz(id.mail_begin, id.mail_end - id.mail_end);
+               xmemdupz(id.mail_begin, id.mail_end - id.mail_begin);
 }
 
 /**
@@ -1595,7 +1595,7 @@ static void do_commit(const struct am_state *state)
 
        if (state->committer_date_is_author_date)
                committer = fmt_ident(state->committer_name,
-                                     state->author_email, WANT_COMMITTER_IDENT,
+                                     state->committer_email, WANT_COMMITTER_IDENT,
                                      state->ignore_date ? NULL
                                                         : state->author_date,
                                      IDENT_STRICT);
@@ -2180,6 +2180,8 @@ static int parse_opt_show_current_patch(const struct option *opt, const char *ar
        };
        int new_value = SHOW_PATCH_RAW;
 
+       BUG_ON_OPT_NEG(unset);
+
        if (arg) {
                for (new_value = 0; new_value < ARRAY_SIZE(valid_modes); new_value++) {
                        if (!strcmp(arg, valid_modes[new_value]))
@@ -2235,7 +2237,7 @@ int cmd_am(int argc, const char **argv, const char *prefix)
                        N_("allow fall back on 3way merging if needed")),
                OPT__QUIET(&state.quiet, N_("be quiet")),
                OPT_SET_INT('s', "signoff", &state.signoff,
-                       N_("add a Signed-off-by line to the commit message"),
+                       N_("add a Signed-off-by trailer to the commit message"),
                        SIGNOFF_EXPLICIT),
                OPT_BOOL('u', "utf8", &state.utf8,
                        N_("recode into utf8 (default)")),