diff options
| -rw-r--r-- | pager.c | 2 | ||||
| -rw-r--r-- | sequencer.c | 7 | ||||
| -rwxr-xr-x | t/t3400-rebase.sh | 6 |
3 files changed, 12 insertions, 3 deletions
@@ -234,6 +234,8 @@ int term_columns(void) */ void term_clear_line(void) { + if (!isatty(2)) + return; if (is_terminal_dumb()) /* * Fall back to print a terminal width worth of space diff --git a/sequencer.c b/sequencer.c index e592df0f51..8d01cd50ac 100644 --- a/sequencer.c +++ b/sequencer.c @@ -3794,12 +3794,13 @@ static int error_failed_squash(struct repository *r, return error_with_patch(r, commit, subject, subject_len, opts, 1, 0); } -static int do_exec(struct repository *r, const char *command_line) +static int do_exec(struct repository *r, const char *command_line, int quiet) { struct child_process cmd = CHILD_PROCESS_INIT; int dirty, status; - fprintf(stderr, _("Executing: %s\n"), command_line); + if (!quiet) + fprintf(stderr, _("Executing: %s\n"), command_line); cmd.use_shell = 1; strvec_push(&cmd.args, command_line); strvec_push(&cmd.env, "GIT_CHERRY_PICK_HELP"); @@ -5014,7 +5015,7 @@ static int pick_commits(struct repository *r, if (!opts->verbose) term_clear_line(); *end_of_arg = '\0'; - res = do_exec(r, arg); + res = do_exec(r, arg, opts->quiet); *end_of_arg = saved; if (res) { diff --git a/t/t3400-rebase.sh b/t/t3400-rebase.sh index ae34bfad60..bd8bcc381a 100755 --- a/t/t3400-rebase.sh +++ b/t/t3400-rebase.sh @@ -235,6 +235,12 @@ test_expect_success 'rebase --merge -q is quiet' ' test_must_be_empty output.out ' +test_expect_success 'rebase --exec -q is quiet' ' + git checkout -B quiet topic && + git rebase --exec true -q main >output.out 2>&1 && + test_must_be_empty output.out +' + test_expect_success 'Rebase a commit that sprinkles CRs in' ' ( echo "One" && |
