From fc5cb99f675b2052f6d6bd3e2520379031b12267 Mon Sep 17 00:00:00 2001 From: "brian m. carlson" Date: Mon, 12 Mar 2018 02:27:23 +0000 Subject: cache-tree: convert write_*_as_tree to object_id Convert write_index_as_tree and write_cache_as_tree to use struct object_id. Signed-off-by: brian m. carlson Signed-off-by: Junio C Hamano --- sequencer.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'sequencer.c') diff --git a/sequencer.c b/sequencer.c index 969755b7e0..c8160e974d 100644 --- a/sequencer.c +++ b/sequencer.c @@ -1113,7 +1113,7 @@ static int try_to_commit(struct strbuf *msg, const char *author, commit_list_insert(current_head, &parents); } - if (write_cache_as_tree(tree.hash, 0, NULL)) { + if (write_cache_as_tree(&tree, 0, NULL)) { res = error(_("git write-tree failed to write a tree")); goto out; } @@ -1475,7 +1475,7 @@ static int do_pick_commit(enum todo_command command, struct commit *commit, * that represents the "current" state for merge-recursive * to work on. */ - if (write_cache_as_tree(head.hash, 0, NULL)) + if (write_cache_as_tree(&head, 0, NULL)) return error(_("your index file is unmerged.")); } else { unborn = get_oid("HEAD", &head); -- cgit v1.2.3 From aab9583f7b5ea5463eb3f653a0b4ecac7539dc94 Mon Sep 17 00:00:00 2001 From: "brian m. carlson" Date: Mon, 12 Mar 2018 02:27:30 +0000 Subject: Convert find_unique_abbrev* to struct object_id Convert find_unique_abbrev and find_unique_abbrev_r to each take a pointer to struct object_id. Signed-off-by: brian m. carlson Signed-off-by: Junio C Hamano --- sequencer.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'sequencer.c') diff --git a/sequencer.c b/sequencer.c index c8160e974d..c994392caf 100644 --- a/sequencer.c +++ b/sequencer.c @@ -282,7 +282,7 @@ struct commit_message { static const char *short_commit_name(struct commit *commit) { - return find_unique_abbrev(commit->object.oid.hash, DEFAULT_ABBREV); + return find_unique_abbrev(&commit->object.oid, DEFAULT_ABBREV); } static int get_message(struct commit *commit, struct commit_message *out) -- cgit v1.2.3 From abef9020e3df87c441c9a3a95f592fce5fa49bb9 Mon Sep 17 00:00:00 2001 From: "brian m. carlson" Date: Mon, 12 Mar 2018 02:27:46 +0000 Subject: sha1_file: convert sha1_object_info* to object_id Convert sha1_object_info and sha1_object_info_extended to take pointers to struct object_id and rename them to use "oid" instead of "sha1" in their names. Update the declaration and definition and apply the following semantic patch, plus the standard object_id transforms: @@ expression E1, E2; @@ - sha1_object_info(E1.hash, E2) + oid_object_info(&E1, E2) @@ expression E1, E2; @@ - sha1_object_info(E1->hash, E2) + oid_object_info(E1, E2) @@ expression E1, E2, E3; @@ - sha1_object_info_extended(E1.hash, E2, E3) + oid_object_info_extended(&E1, E2, E3) @@ expression E1, E2, E3; @@ - sha1_object_info_extended(E1->hash, E2, E3) + oid_object_info_extended(E1, E2, E3) Signed-off-by: Junio C Hamano --- sequencer.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'sequencer.c') diff --git a/sequencer.c b/sequencer.c index c994392caf..47b050edfb 100644 --- a/sequencer.c +++ b/sequencer.c @@ -2881,7 +2881,8 @@ int sequencer_pick_revisions(struct replay_opts *opts) if (!get_oid(name, &oid)) { if (!lookup_commit_reference_gently(&oid, 1)) { - enum object_type type = sha1_object_info(oid.hash, NULL); + enum object_type type = oid_object_info(&oid, + NULL); return error(_("%s: can't cherry-pick a %s"), name, type_name(type)); } -- cgit v1.2.3