apply: make some parsing functions static again
[gitweb.git] / sequencer.c
index c6362d63f35fe37d67fa235784ab8ce75a60db44..cdfac82b117e9ff1084f3fbe36eeb85f45ce056c 100644 (file)
@@ -190,7 +190,7 @@ static void write_message(struct strbuf *msgbuf, const char *filename)
                die_errno(_("Could not write to %s"), filename);
        strbuf_release(msgbuf);
        if (commit_lock_file(&msg_file) < 0)
-               die(_("Error wrapping up %s"), filename);
+               die(_("Error wrapping up %s."), filename);
 }
 
 static struct tree *empty_tree(void)
@@ -225,7 +225,7 @@ static int fast_forward_to(const unsigned char *to, const unsigned char *from,
        if (checkout_fast_forward(from, to, 1))
                exit(128); /* the callee should have complained already */
 
-       strbuf_addf(&sb, "%s: fast-forward", action_name(opts));
+       strbuf_addf(&sb, _("%s: fast-forward"), action_name(opts));
 
        transaction = ref_transaction_begin(&err);
        if (!transaction ||
@@ -544,10 +544,8 @@ static int do_pick_commit(struct commit *commit, struct replay_opts *opts)
                 * information followed by "\n\n".
                 */
                p = strstr(msg.message, "\n\n");
-               if (p) {
-                       p += 2;
-                       strbuf_addstr(&msgbuf, p);
-               }
+               if (p)
+                       strbuf_addstr(&msgbuf, skip_blank_lines(p + 2));
 
                if (opts->record_origin) {
                        if (!has_conforming_footer(&msgbuf, NULL, 0))
@@ -697,9 +695,14 @@ static struct commit *parse_insn_line(char *bol, char *eol, struct replay_opts *
         * opts; we don't support arbitrary instructions
         */
        if (action != opts->action) {
-               const char *action_str;
-               action_str = action == REPLAY_REVERT ? "revert" : "cherry-pick";
-               error(_("Cannot %s during a %s"), action_str, action_name(opts));
+               if (action == REPLAY_REVERT)
+                     error((opts->action == REPLAY_REVERT)
+                           ? _("Cannot revert during a another revert.")
+                           : _("Cannot revert during a cherry-pick."));
+               else
+                     error((opts->action == REPLAY_REVERT)
+                           ? _("Cannot cherry-pick during a revert.")
+                           : _("Cannot cherry-pick during another cherry-pick."));
                return NULL;
        }