cat-file --batch: flush stdout also when objects are missing
cat-file --batch/--batch-check only flushes stdout when the object exists, but not when it doesn't ("<object> missing"). This makes bidirectional pipes hang. Signed-off-by: Lea Wiemann <LeWiemann@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Lea Wiemann committed
Jun 3, 2008 at 20:34 UTC
422b206342047c9290362caeaa10cddbe3f9a23e
1 file changed
+1
builtin-cat-file.c
+1
@@ -159,6 +159,7 @@ static int batch_one_object(const char *obj_name, int print_contents)
159
160
if (get_sha1(obj_name, sha1)) {
161
printf("%s missing\n", obj_name);
162
+ fflush(stdout);
163
return 0;
164
}
165