DORMANTno replies

[PATCH] shortlog: do not stall when there is no input

From: Michele Ballabio <hidden>
Date: 2016-06-15 22:48:21
Subsystem: the rest · Maintainer: Linus Torvalds

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 <redacted>
---
 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
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help