diff --git a/builtin-cat-file.c b/builtin-cat-file.c
index f8b3160668e1eeff3ef9a893459c64992aa53b5b..bd343efae7d6cc6fddef4df5c3433b97bd640d3c 100644 (file)
--- a/builtin-cat-file.c
+++ b/builtin-cat-file.c
static int batch_one_object(const char *obj_name, int print_contents)
{
unsigned char sha1[20];
- enum object_type type;
+ enum object_type type = 0;
unsigned long size;
void *contents = contents;
else
type = sha1_object_info(sha1, &size);
- if (type <= 0)
- return 1;
+ if (type <= 0) {
+ printf("%s missing\n", obj_name);
+ fflush(stdout);
+ return 0;
+ }
printf("%s %s %lu\n", sha1_to_hex(sha1), typename(type), size);
fflush(stdout);