Skip to content

Commit 33d66df

Browse files
bk2204gitster
authored andcommitted
sequencer: convert some functions to struct object_id
Convert update_squash_messages and is_index_unchanged to struct object_id. These are callers of lookup_commit and lookup_commit_reference, which we want to convert. Signed-off-by: brian m. carlson <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent e92b848 commit 33d66df

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

sequencer.c

+6-6
Original file line numberDiff line numberDiff line change
@@ -482,13 +482,13 @@ static int do_recursive_merge(struct commit *base, struct commit *next,
482482

483483
static int is_index_unchanged(void)
484484
{
485-
unsigned char head_sha1[20];
485+
struct object_id head_oid;
486486
struct commit *head_commit;
487487

488-
if (!resolve_ref_unsafe("HEAD", RESOLVE_REF_READING, head_sha1, NULL))
488+
if (!resolve_ref_unsafe("HEAD", RESOLVE_REF_READING, head_oid.hash, NULL))
489489
return error(_("could not resolve HEAD commit\n"));
490490

491-
head_commit = lookup_commit(head_sha1);
491+
head_commit = lookup_commit(head_oid.hash);
492492

493493
/*
494494
* If head_commit is NULL, check_commit, called from
@@ -835,13 +835,13 @@ static int update_squash_messages(enum todo_command command,
835835
strbuf_splice(&buf, 0, eol - buf.buf, header.buf, header.len);
836836
strbuf_release(&header);
837837
} else {
838-
unsigned char head[20];
838+
struct object_id head;
839839
struct commit *head_commit;
840840
const char *head_message, *body;
841841

842-
if (get_sha1("HEAD", head))
842+
if (get_oid("HEAD", &head))
843843
return error(_("need a HEAD to fixup"));
844-
if (!(head_commit = lookup_commit_reference(head)))
844+
if (!(head_commit = lookup_commit_reference(head.hash)))
845845
return error(_("could not read HEAD"));
846846
if (!(head_message = get_commit_buffer(head_commit, NULL)))
847847
return error(_("could not read HEAD's commit message"));

0 commit comments

Comments
 (0)