Skip to content

Commit

Permalink
cat-file --batch: flush stdout also when objects are missing
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Lea Wiemann authored and Junio C Hamano committed Jun 3, 2008
1 parent 02c1719 commit 422b206
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions builtin-cat-file.c
Original file line number Diff line number Diff line change
Expand Up @@ -159,6 +159,7 @@ static int batch_one_object(const char *obj_name, int print_contents)

if (get_sha1(obj_name, sha1)) {
printf("%s missing\n", obj_name);
fflush(stdout);
return 0;
}

Expand Down

0 comments on commit 422b206

Please sign in to comment.