MCPcopy Create free account
hub / github.com/git/git / append_merge_parents

Function append_merge_parents

blame.c:145–168  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

143}
144
145static 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

Callers 1

fake_working_tree_commitFunction · 0.85

Calls 5

strbuf_getwholeline_fdFunction · 0.85
get_oid_hexFunction · 0.85
append_parentFunction · 0.85
strbuf_releaseFunction · 0.85
dieFunction · 0.70

Tested by

no test coverage detected