mirror of
https://github.com/git/git.git
synced 2024-11-26 03:14:50 +08:00
checkout: no progress messages if !isatty(2).
If stderr isn't a tty, we shouldn't be printing incremental progress messages. In particular, this affects 'git checkout -f . >&logfile' unless you provided -q. And git-new-workdir has no way to provide -q. It would probably be better to have progress.c check isatty(2) all the time, but that wouldn't allow things like 'git push --progress' to force progress reporting to on, so I won't try to solve the general case right now. Actual fix suggested by Jeff King. Signed-off-by: Avery Pennarun <apenwarr@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
This commit is contained in:
parent
17a9ac7d6b
commit
e9fc64c60a
@ -343,7 +343,7 @@ static int reset_tree(struct tree *tree, struct checkout_opts *o, int worktree)
|
||||
opts.reset = 1;
|
||||
opts.merge = 1;
|
||||
opts.fn = oneway_merge;
|
||||
opts.verbose_update = !o->quiet;
|
||||
opts.verbose_update = !o->quiet && isatty(2);
|
||||
opts.src_index = &the_index;
|
||||
opts.dst_index = &the_index;
|
||||
parse_tree(tree);
|
||||
@ -420,7 +420,7 @@ static int merge_working_tree(struct checkout_opts *opts,
|
||||
topts.update = 1;
|
||||
topts.merge = 1;
|
||||
topts.gently = opts->merge && old->commit;
|
||||
topts.verbose_update = !opts->quiet;
|
||||
topts.verbose_update = !opts->quiet && isatty(2);
|
||||
topts.fn = twoway_merge;
|
||||
if (opts->overwrite_ignore) {
|
||||
topts.dir = xcalloc(1, sizeof(*topts.dir));
|
||||
|
Loading…
Reference in New Issue
Block a user