path: root/builtin/commit.c
diff options
authorJunio C Hamano <>2015-12-10 20:36:13 (GMT)
committerJunio C Hamano <>2015-12-10 20:36:13 (GMT)
commit844a9ce47208de173341525c15a4c8c689dd278e (patch)
treed771915b28609179ddf1f3f911bcb30b7019d7cf /builtin/commit.c
parentb12a966eff3f66337f83c117dbab8fa0cca16e4b (diff)
parentfcd30b138759a2ab5ecb55758c3341f0d608df2b (diff)
Merge branch 'bc/object-id'
More transition from "unsigned char[40]" to "struct object_id". This needed a few merge fixups, but is mostly disentangled from other topics. * bc/object-id: remote: convert functions to struct object_id Remove get_object_hash. Convert struct object to object_id Add several uses of get_object_hash. object: introduce get_object_hash macro. ref_newer: convert to use struct object_id push_refs_with_export: convert to struct object_id get_remote_heads: convert to struct object_id parse_fetch: convert to use struct object_id add_sought_entry_mem: convert to struct object_id Convert struct ref to use object_id. sha1_file: introduce has_object_file helper.
Diffstat (limited to 'builtin/commit.c')
1 files changed, 4 insertions, 4 deletions
diff --git a/builtin/commit.c b/builtin/commit.c
index f2a8b78..d054f84 100644
--- a/builtin/commit.c
+++ b/builtin/commit.c
@@ -300,7 +300,7 @@ static void create_base_index(const struct commit *current_head)
opts.dst_index = &the_index;
opts.fn = oneway_merge;
- tree = parse_tree_indirect(current_head->object.sha1);
+ tree = parse_tree_indirect(current_head->object.oid.hash);
if (!tree)
die(_("failed to unpack HEAD tree object"));
@@ -1769,7 +1769,7 @@ int cmd_commit(int argc, const char **argv, const char *prefix)
if (!transaction ||
ref_transaction_update(transaction, "HEAD", sha1,
- ? current_head->object.sha1 : null_sha1,
+ ? current_head->object.oid.hash : null_sha1,
0, sb.buf, &err) ||
ref_transaction_commit(transaction, &err)) {
@@ -1796,10 +1796,10 @@ int cmd_commit(int argc, const char **argv, const char *prefix)
cfg = init_copy_notes_for_rewrite("amend");
if (cfg) {
/* we are amending, so current_head is not NULL */
- copy_note_for_rewrite(cfg, current_head->object.sha1, sha1);
+ copy_note_for_rewrite(cfg, current_head->object.oid.hash, sha1);
finish_copy_notes_for_rewrite(cfg, "Notes added by 'git commit --amend'");
- run_rewrite_hook(current_head->object.sha1, sha1);
+ run_rewrite_hook(current_head->object.oid.hash, sha1);
if (!quiet)
print_summary(prefix, sha1, !current_head);