summaryrefslogtreecommitdiff
path: root/sequencer.c
diff options
context:
space:
mode:
authorbrian m. carlson <sandals@crustytoothpaste.net>2017-05-06 22:10:07 (GMT)
committerJunio C Hamano <gitster@pobox.com>2017-05-08 06:12:57 (GMT)
commit33d66df34ece4f597590263df502ff3578b6becd (patch)
treecd3f5214fc9eebe5bd05c9221a7f5e5f1b0bb646 /sequencer.c
parente92b848cb6a77172d2fbd2bda39a32e371d40eea (diff)
downloadgit-33d66df34ece4f597590263df502ff3578b6becd.zip
git-33d66df34ece4f597590263df502ff3578b6becd.tar.gz
git-33d66df34ece4f597590263df502ff3578b6becd.tar.bz2
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 <sandals@crustytoothpaste.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'sequencer.c')
-rw-r--r--sequencer.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/sequencer.c b/sequencer.c
index b0f862b..b94830c 100644
--- a/sequencer.c
+++ b/sequencer.c
@@ -482,13 +482,13 @@ static int do_recursive_merge(struct commit *base, struct commit *next,
static int is_index_unchanged(void)
{
- unsigned char head_sha1[20];
+ struct object_id head_oid;
struct commit *head_commit;
- if (!resolve_ref_unsafe("HEAD", RESOLVE_REF_READING, head_sha1, NULL))
+ if (!resolve_ref_unsafe("HEAD", RESOLVE_REF_READING, head_oid.hash, NULL))
return error(_("could not resolve HEAD commit\n"));
- head_commit = lookup_commit(head_sha1);
+ head_commit = lookup_commit(head_oid.hash);
/*
* If head_commit is NULL, check_commit, called from
@@ -835,13 +835,13 @@ static int update_squash_messages(enum todo_command command,
strbuf_splice(&buf, 0, eol - buf.buf, header.buf, header.len);
strbuf_release(&header);
} else {
- unsigned char head[20];
+ struct object_id head;
struct commit *head_commit;
const char *head_message, *body;
- if (get_sha1("HEAD", head))
+ if (get_oid("HEAD", &head))
return error(_("need a HEAD to fixup"));
- if (!(head_commit = lookup_commit_reference(head)))
+ if (!(head_commit = lookup_commit_reference(head.hash)))
return error(_("could not read HEAD"));
if (!(head_message = get_commit_buffer(head_commit, NULL)))
return error(_("could not read HEAD's commit message"));