mirror of
https://github.com/git/git.git
synced 2026-01-10 10:13:33 +00:00
Merge branch 'mt/rebase-x-quiet'
"git rebase -x --quiet" was not quiet, which was corrected. * mt/rebase-x-quiet: rebase --exec: respect --quiet
This commit is contained in:
2
pager.c
2
pager.c
@@ -234,6 +234,8 @@ int term_columns(void)
|
|||||||
*/
|
*/
|
||||||
void term_clear_line(void)
|
void term_clear_line(void)
|
||||||
{
|
{
|
||||||
|
if (!isatty(2))
|
||||||
|
return;
|
||||||
if (is_terminal_dumb())
|
if (is_terminal_dumb())
|
||||||
/*
|
/*
|
||||||
* Fall back to print a terminal width worth of space
|
* Fall back to print a terminal width worth of space
|
||||||
|
|||||||
@@ -3794,12 +3794,13 @@ static int error_failed_squash(struct repository *r,
|
|||||||
return error_with_patch(r, commit, subject, subject_len, opts, 1, 0);
|
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;
|
struct child_process cmd = CHILD_PROCESS_INIT;
|
||||||
int dirty, status;
|
int dirty, status;
|
||||||
|
|
||||||
fprintf(stderr, _("Executing: %s\n"), command_line);
|
if (!quiet)
|
||||||
|
fprintf(stderr, _("Executing: %s\n"), command_line);
|
||||||
cmd.use_shell = 1;
|
cmd.use_shell = 1;
|
||||||
strvec_push(&cmd.args, command_line);
|
strvec_push(&cmd.args, command_line);
|
||||||
strvec_push(&cmd.env, "GIT_CHERRY_PICK_HELP");
|
strvec_push(&cmd.env, "GIT_CHERRY_PICK_HELP");
|
||||||
@@ -5014,7 +5015,7 @@ static int pick_commits(struct repository *r,
|
|||||||
if (!opts->verbose)
|
if (!opts->verbose)
|
||||||
term_clear_line();
|
term_clear_line();
|
||||||
*end_of_arg = '\0';
|
*end_of_arg = '\0';
|
||||||
res = do_exec(r, arg);
|
res = do_exec(r, arg, opts->quiet);
|
||||||
*end_of_arg = saved;
|
*end_of_arg = saved;
|
||||||
|
|
||||||
if (res) {
|
if (res) {
|
||||||
|
|||||||
@@ -235,6 +235,12 @@ test_expect_success 'rebase --merge -q is quiet' '
|
|||||||
test_must_be_empty output.out
|
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' '
|
test_expect_success 'Rebase a commit that sprinkles CRs in' '
|
||||||
(
|
(
|
||||||
echo "One" &&
|
echo "One" &&
|
||||||
|
|||||||
Reference in New Issue
Block a user