| 4357 | } |
| 4358 | |
| 4359 | static void read_object_list_from_stdin(void) |
| 4360 | { |
| 4361 | char line[GIT_MAX_HEXSZ + 1 + PATH_MAX + 2]; |
| 4362 | struct object_id oid; |
| 4363 | const char *p; |
| 4364 | |
| 4365 | for (;;) { |
| 4366 | if (!fgets(line, sizeof(line), stdin)) { |
| 4367 | if (feof(stdin)) |
| 4368 | break; |
| 4369 | if (!ferror(stdin)) |
| 4370 | BUG("fgets returned NULL, not EOF, not error!"); |
| 4371 | if (errno != EINTR) |
| 4372 | die_errno("fgets"); |
| 4373 | clearerr(stdin); |
| 4374 | continue; |
| 4375 | } |
| 4376 | if (line[0] == '-') { |
| 4377 | if (get_oid_hex(line+1, &oid)) |
| 4378 | die(_("expected edge object ID, got garbage:\n %s"), |
| 4379 | line); |
| 4380 | add_preferred_base(&oid); |
| 4381 | continue; |
| 4382 | } |
| 4383 | if (parse_oid_hex(line, &oid, &p)) |
| 4384 | die(_("expected object ID, got garbage:\n %s"), line); |
| 4385 | |
| 4386 | add_preferred_base_object(p + 1); |
| 4387 | add_object_entry(&oid, OBJ_NONE, p + 1, 0); |
| 4388 | } |
| 4389 | } |
| 4390 | |
| 4391 | static void show_commit(struct commit *commit, void *data UNUSED) |
| 4392 | { |
no test coverage detected