builtin/pull: convert portions to struct object_id
Convert the caller of sha1_array_append to struct object_id. Signed-off-by: brian m. carlson <sandals@crustytoothpaste.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
brian m. carlson committed
Mar 26, 2017 at 16:01 UTC
14bb40b3f0c646ca81609be1eb3039ede6ce5cc4
1 file changed
+3
-3
builtin/pull.c
+3
-3
@@ -335,16 +335,16 @@ static void get_merge_heads(struct sha1_array *merge_heads)
335
const char *filename = git_path("FETCH_HEAD");
336
FILE *fp;
337
struct strbuf sb = STRBUF_INIT;
338
- unsigned char sha1[GIT_SHA1_RAWSZ];
338
+ struct object_id oid;
339
340
if (!(fp = fopen(filename, "r")))
341
die_errno(_("could not open '%s' for reading"), filename);
342
while (strbuf_getline_lf(&sb, fp) != EOF) {
343
- if (get_sha1_hex(sb.buf, sha1))
343
+ if (get_oid_hex(sb.buf, &oid))
344
continue; /* invalid line: does not start with SHA1 */
345
if (starts_with(sb.buf + GIT_SHA1_HEXSZ, "\tnot-for-merge\t"))
346
continue; /* ref is not-for-merge */
347
- sha1_array_append(merge_heads, sha1);
347
+ sha1_array_append(merge_heads, oid.hash);
348
}
349
fclose(fp);
350
strbuf_release(&sb);