From: Michele Ballabio Date: Wed, 24 Feb 2010 19:20:27 GMT Subject: [PATCH] shortlog: do not stall when there is no input Message-ID: <201002242020.27801.barra_cuda@katamail.com> A simple "git shortlog" outside of a git repository used to stall waiting for an input. Fix this by testing with isatty() before calling read_from_stdin(). Signed-off-by: Michele Ballabio --- builtin-shortlog.c | 3 +-- 1 files changed, 1 insertions(+), 2 deletions(-) diff --git a/builtin-shortlog.c b/builtin-shortlog.c index b3b055f..ff5dca6 100644 --- a/builtin-shortlog.c +++ b/builtin-shortlog.c @@ -294,9 +294,8 @@ parse_done: /* assume HEAD if from a tty */ if (!nongit && !rev.pending.nr && isatty(0)) add_head_to_pending(&rev); - if (rev.pending.nr == 0) { + if (rev.pending.nr == 0 && !isatty(0)) read_from_stdin(&log); - } else get_from_rev(&rev, &log); -- 1.7.0