| 143 | } |
| 144 | |
| 145 | static void append_merge_parents(struct repository *r, |
| 146 | struct commit_list **tail) |
| 147 | { |
| 148 | int merge_head; |
| 149 | struct strbuf line = STRBUF_INIT; |
| 150 | |
| 151 | merge_head = open(git_path_merge_head(r), O_RDONLY); |
| 152 | if (merge_head < 0) { |
| 153 | if (errno == ENOENT) |
| 154 | return; |
| 155 | die("cannot open '%s' for reading", |
| 156 | git_path_merge_head(r)); |
| 157 | } |
| 158 | |
| 159 | while (!strbuf_getwholeline_fd(&line, merge_head, '\n')) { |
| 160 | struct object_id oid; |
| 161 | if (get_oid_hex(line.buf, &oid)) |
| 162 | die("unknown line in '%s': %s", |
| 163 | git_path_merge_head(r), line.buf); |
| 164 | tail = append_parent(r, tail, &oid); |
| 165 | } |
| 166 | close(merge_head); |
| 167 | strbuf_release(&line); |
| 168 | } |
| 169 | |
| 170 | /* |
| 171 | * This isn't as simple as passing sb->buf and sb->len, because we |
no test coverage detected