t3420: fix under GETTEXT_POISON build
[gitweb.git] / sequencer.c
index 1f729b053bbc6f544fe0b3e8736113082894b24d..fd75d51bd698dd56abea52be6576c791cb2273a3 100644 (file)
@@ -1898,11 +1898,13 @@ static int apply_autostash(struct replay_opts *opts)
        strbuf_trim(&stash_sha1);
 
        child.git_cmd = 1;
+       child.no_stdout = 1;
+       child.no_stderr = 1;
        argv_array_push(&child.args, "stash");
        argv_array_push(&child.args, "apply");
        argv_array_push(&child.args, stash_sha1.buf);
        if (!run_command(&child))
-               printf(_("Applied autostash."));
+               fprintf(stderr, _("Applied autostash.\n"));
        else {
                struct child_process store = CHILD_PROCESS_INIT;
 
@@ -1916,10 +1918,11 @@ static int apply_autostash(struct replay_opts *opts)
                if (run_command(&store))
                        ret = error(_("cannot store %s"), stash_sha1.buf);
                else
-                       printf(_("Applying autostash resulted in conflicts.\n"
-                               "Your changes are safe in the stash.\n"
-                               "You can run \"git stash pop\" or"
-                               " \"git stash drop\" at any time.\n"));
+                       fprintf(stderr,
+                               _("Applying autostash resulted in conflicts.\n"
+                                 "Your changes are safe in the stash.\n"
+                                 "You can run \"git stash pop\" or"
+                                 " \"git stash drop\" at any time.\n"));
        }
 
        strbuf_release(&stash_sha1);
@@ -1997,7 +2000,8 @@ static int pick_commits(struct todo_list *todo_list, struct replay_opts *opts)
                        if (item->command == TODO_EDIT) {
                                struct commit *commit = item->commit;
                                if (!res)
-                                       warning(_("stopped at %s... %.*s"),
+                                       fprintf(stderr,
+                                               _("Stopped at %s...  %.*s\n"),
                                                short_commit_name(commit),
                                                item->arg_len, item->arg);
                                return error_with_patch(commit,
@@ -2057,6 +2061,7 @@ static int pick_commits(struct todo_list *todo_list, struct replay_opts *opts)
                                res = error(_("could not read orig-head"));
                                goto cleanup_head_ref;
                        }
+                       strbuf_reset(&buf);
                        if (!read_oneliner(&buf, rebase_path_onto(), 0)) {
                                res = error(_("could not read 'onto'"));
                                goto cleanup_head_ref;