Skip to content

Commit 63cdf16

Browse files
committed
Merge branch 'ap/checkout-no-progress-for-non-tty' into maint
"git checkout" gave progress display even when the standard error stream was not connected to the tty, which made little sense. By Avery Pennarun * ap/checkout-no-progress-for-non-tty: checkout: no progress messages if !isatty(2).
2 parents 9c136bf + e9fc64c commit 63cdf16

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

builtin/checkout.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -343,7 +343,7 @@ static int reset_tree(struct tree *tree, struct checkout_opts *o, int worktree)
343343
opts.reset = 1;
344344
opts.merge = 1;
345345
opts.fn = oneway_merge;
346-
opts.verbose_update = !o->quiet;
346+
opts.verbose_update = !o->quiet && isatty(2);
347347
opts.src_index = &the_index;
348348
opts.dst_index = &the_index;
349349
parse_tree(tree);
@@ -420,7 +420,7 @@ static int merge_working_tree(struct checkout_opts *opts,
420420
topts.update = 1;
421421
topts.merge = 1;
422422
topts.gently = opts->merge && old->commit;
423-
topts.verbose_update = !opts->quiet;
423+
topts.verbose_update = !opts->quiet && isatty(2);
424424
topts.fn = twoway_merge;
425425
if (opts->overwrite_ignore) {
426426
topts.dir = xcalloc(1, sizeof(*topts.dir));

0 commit comments

Comments
 (0)