| 801 | } |
| 802 | |
| 803 | static int read_refs_snapshot(const char *refs_snapshot, |
| 804 | struct rev_info *revs) |
| 805 | { |
| 806 | struct strbuf buf = STRBUF_INIT; |
| 807 | struct object_id oid; |
| 808 | FILE *f = xfopen(refs_snapshot, "r"); |
| 809 | |
| 810 | while (strbuf_getline(&buf, f) != EOF) { |
| 811 | struct object *object; |
| 812 | int preferred = 0; |
| 813 | char *hex = buf.buf; |
| 814 | const char *end = NULL; |
| 815 | |
| 816 | if (buf.len && *buf.buf == '+') { |
| 817 | preferred = 1; |
| 818 | hex = &buf.buf[1]; |
| 819 | } |
| 820 | |
| 821 | if (parse_oid_hex_algop(hex, &oid, &end, revs->repo->hash_algo) < 0) |
| 822 | die(_("could not parse line: %s"), buf.buf); |
| 823 | if (*end) |
| 824 | die(_("malformed line: %s"), buf.buf); |
| 825 | |
| 826 | object = parse_object_or_die(revs->repo, &oid, NULL); |
| 827 | if (preferred) |
| 828 | object->flags |= NEEDS_BITMAP; |
| 829 | |
| 830 | add_pending_object(revs, object, ""); |
| 831 | } |
| 832 | |
| 833 | fclose(f); |
| 834 | strbuf_release(&buf); |
| 835 | return 0; |
| 836 | } |
| 837 | |
| 838 | static void find_commits_for_midx_bitmap(struct commit_stack *commits, |
| 839 | const char *refs_snapshot, |
no test coverage detected