summaryrefslogtreecommitdiff
path: root/notes-merge.c
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2015-12-10 20:36:13 (GMT)
committerJunio C Hamano <gitster@pobox.com>2015-12-10 20:36:13 (GMT)
commit844a9ce47208de173341525c15a4c8c689dd278e (patch)
treed771915b28609179ddf1f3f911bcb30b7019d7cf /notes-merge.c
parentb12a966eff3f66337f83c117dbab8fa0cca16e4b (diff)
parentfcd30b138759a2ab5ecb55758c3341f0d608df2b (diff)
downloadgit-844a9ce47208de173341525c15a4c8c689dd278e.zip
git-844a9ce47208de173341525c15a4c8c689dd278e.tar.gz
git-844a9ce47208de173341525c15a4c8c689dd278e.tar.bz2
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 'notes-merge.c')
-rw-r--r--notes-merge.c24
1 files changed, 12 insertions, 12 deletions
diff --git a/notes-merge.c b/notes-merge.c
index b3d1dab..34bfac0 100644
--- a/notes-merge.c
+++ b/notes-merge.c
@@ -602,15 +602,15 @@ int notes_merge(struct notes_merge_options *o,
if (o->verbosity >= 4)
printf("No merge base found; doing history-less merge\n");
} else if (!bases->next) {
- base_sha1 = bases->item->object.sha1;
- base_tree_sha1 = bases->item->tree->object.sha1;
+ base_sha1 = bases->item->object.oid.hash;
+ base_tree_sha1 = bases->item->tree->object.oid.hash;
if (o->verbosity >= 4)
printf("One merge base found (%.7s)\n",
sha1_to_hex(base_sha1));
} else {
/* TODO: How to handle multiple merge-bases? */
- base_sha1 = bases->item->object.sha1;
- base_tree_sha1 = bases->item->tree->object.sha1;
+ base_sha1 = bases->item->object.oid.hash;
+ base_tree_sha1 = bases->item->tree->object.oid.hash;
if (o->verbosity >= 3)
printf("Multiple merge bases found. Using the first "
"(%.7s)\n", sha1_to_hex(base_sha1));
@@ -618,27 +618,27 @@ int notes_merge(struct notes_merge_options *o,
if (o->verbosity >= 4)
printf("Merging remote commit %.7s into local commit %.7s with "
- "merge-base %.7s\n", sha1_to_hex(remote->object.sha1),
- sha1_to_hex(local->object.sha1),
+ "merge-base %.7s\n", oid_to_hex(&remote->object.oid),
+ oid_to_hex(&local->object.oid),
sha1_to_hex(base_sha1));
- if (!hashcmp(remote->object.sha1, base_sha1)) {
+ if (!hashcmp(remote->object.oid.hash, base_sha1)) {
/* Already merged; result == local commit */
if (o->verbosity >= 2)
printf("Already up-to-date!\n");
- hashcpy(result_sha1, local->object.sha1);
+ hashcpy(result_sha1, local->object.oid.hash);
goto found_result;
}
- if (!hashcmp(local->object.sha1, base_sha1)) {
+ if (!hashcmp(local->object.oid.hash, base_sha1)) {
/* Fast-forward; result == remote commit */
if (o->verbosity >= 2)
printf("Fast-forward\n");
- hashcpy(result_sha1, remote->object.sha1);
+ hashcpy(result_sha1, remote->object.oid.hash);
goto found_result;
}
- result = merge_from_diffs(o, base_tree_sha1, local->tree->object.sha1,
- remote->tree->object.sha1, local_tree);
+ result = merge_from_diffs(o, base_tree_sha1, local->tree->object.oid.hash,
+ remote->tree->object.oid.hash, local_tree);
if (result != 0) { /* non-trivial merge (with or without conflicts) */
/* Commit (partial) result */