Remove get_object_hash.

Convert all instances of get_object_hash to use an appropriate reference
to the hash member of the oid member of struct object.  This provides no
functional change, as it is essentially a macro substitution.

Signed-off-by: brian m. carlson <sandals@crustytoothpaste.net>
Signed-off-by: Jeff King <peff@peff.net>
This commit is contained in:
brian m. carlson
2015-11-10 02:22:29 +00:00
committed by Jeff King
parent f2fd0760f6
commit ed1c9977cb
63 changed files with 251 additions and 253 deletions

View File

@ -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 = get_object_hash(bases->item->object);
base_tree_sha1 = get_object_hash(bases->item->tree->object);
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 = get_object_hash(bases->item->object);
base_tree_sha1 = get_object_hash(bases->item->tree->object);
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));
@ -622,23 +622,23 @@ int notes_merge(struct notes_merge_options *o,
oid_to_hex(&local->object.oid),
sha1_to_hex(base_sha1));
if (!hashcmp(get_object_hash(remote->object), 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, get_object_hash(local->object));
hashcpy(result_sha1, local->object.oid.hash);
goto found_result;
}
if (!hashcmp(get_object_hash(local->object), 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, get_object_hash(remote->object));
hashcpy(result_sha1, remote->object.oid.hash);
goto found_result;
}
result = merge_from_diffs(o, base_tree_sha1, get_object_hash(local->tree->object),
get_object_hash(remote->tree->object), 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 */