]> git.ipfire.org Git - thirdparty/git.git/blobdiff - builtin/am.c
Merge branch 'tk/stripspace'
[thirdparty/git.git] / builtin / am.c
index c869796ea6e8faab62b4c258a2a84ad3254d520f..4e396c832139aa3c4ae4e68e9d265b0107817aa9 100644 (file)
@@ -1343,7 +1343,7 @@ static int parse_mail(struct am_state *state, const char *mail)
        strbuf_addstr(&msg, "\n\n");
        if (strbuf_read_file(&msg, am_path(state, "msg"), 0) < 0)
                die_errno(_("could not read '%s'"), am_path(state, "msg"));
-       stripspace(&msg, 0);
+       strbuf_stripspace(&msg, 0);
 
        if (state->signoff)
                am_signoff(&msg);
@@ -2225,6 +2225,17 @@ enum resume_mode {
        RESUME_ABORT
 };
 
+static int git_am_config(const char *k, const char *v, void *cb)
+{
+       int status;
+
+       status = git_gpg_config(k, v, NULL);
+       if (status)
+               return status;
+
+       return git_default_config(k, v, NULL);
+}
+
 int cmd_am(int argc, const char **argv, const char *prefix)
 {
        struct am_state state;
@@ -2235,8 +2246,8 @@ int cmd_am(int argc, const char **argv, const char *prefix)
        int in_progress;
 
        const char * const usage[] = {
-               N_("git am [options] [(<mbox>|<Maildir>)...]"),
-               N_("git am [options] (--continue | --skip | --abort)"),
+               N_("git am [<options>] [(<mbox>|<Maildir>)...]"),
+               N_("git am [<options>] (--continue | --skip | --abort)"),
                NULL
        };
 
@@ -2325,7 +2336,7 @@ int cmd_am(int argc, const char **argv, const char *prefix)
                OPT_END()
        };
 
-       git_config(git_default_config, NULL);
+       git_config(git_am_config, NULL);
 
        am_state_init(&state, git_path("rebase-apply"));