summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLibravatar Junio C Hamano <gitster@pobox.com>2018-10-16 16:16:07 +0900
committerLibravatar Junio C Hamano <gitster@pobox.com>2018-10-16 16:16:08 +0900
commitee56992a8792cd5e67029e71f3c75d7ce662ae6d (patch)
treec98f7be58ae6d56b274225d24732697d15c318ac
parentMerge branch 'ma/mailing-list-address-in-git-help' (diff)
parentmore oideq/hasheq conversions (diff)
downloadtgif-ee56992a8792cd5e67029e71f3c75d7ce662ae6d.tar.xz
Merge branch 'jk/oideq-hasheq-cleanup'
Code clean-up. * jk/oideq-hasheq-cleanup: more oideq/hasheq conversions
-rw-r--r--builtin/checkout.c3
-rw-r--r--cache-tree.c2
-rw-r--r--commit-reach.c2
-rw-r--r--midx.c8
4 files changed, 8 insertions, 7 deletions
diff --git a/builtin/checkout.c b/builtin/checkout.c
index b30b48767e..902c06702c 100644
--- a/builtin/checkout.c
+++ b/builtin/checkout.c
@@ -497,7 +497,8 @@ static int skip_merge_working_tree(const struct checkout_opts *opts,
* We must do the merge if we are actually moving to a new commit.
*/
if (!old_branch_info->commit || !new_branch_info->commit ||
- oidcmp(&old_branch_info->commit->object.oid, &new_branch_info->commit->object.oid))
+ !oideq(&old_branch_info->commit->object.oid,
+ &new_branch_info->commit->object.oid))
return 0;
/*
diff --git a/cache-tree.c b/cache-tree.c
index 5ce51468f0..9c5cf2cc4f 100644
--- a/cache-tree.c
+++ b/cache-tree.c
@@ -781,7 +781,7 @@ static void verify_one(struct index_state *istate,
strbuf_add(&tree_buf, oid->hash, the_hash_algo->rawsz);
}
hash_object_file(tree_buf.buf, tree_buf.len, tree_type, &new_oid);
- if (oidcmp(&new_oid, &it->oid))
+ if (!oideq(&new_oid, &it->oid))
BUG("cache-tree for path %.*s does not match. "
"Expected %s got %s", len, path->buf,
oid_to_hex(&new_oid), oid_to_hex(&it->oid));
diff --git a/commit-reach.c b/commit-reach.c
index 67e1792b5c..9f79ce0a22 100644
--- a/commit-reach.c
+++ b/commit-reach.c
@@ -426,7 +426,7 @@ struct contains_stack {
static int in_commit_list(const struct commit_list *want, struct commit *c)
{
for (; want; want = want->next)
- if (!oidcmp(&want->item->object.oid, &c->object.oid))
+ if (oideq(&want->item->object.oid, &c->object.oid))
return 1;
return 0;
}
diff --git a/midx.c b/midx.c
index 713d6f9dde..ea2f3ffe2e 100644
--- a/midx.c
+++ b/midx.c
@@ -282,8 +282,8 @@ static int nth_midxed_pack_entry(struct multi_pack_index *m, struct pack_entry *
struct object_id oid;
nth_midxed_object_oid(&oid, m, pos);
for (i = 0; i < p->num_bad_objects; i++)
- if (!hashcmp(oid.hash,
- p->bad_object_sha1 + the_hash_algo->rawsz * i))
+ if (hasheq(oid.hash,
+ p->bad_object_sha1 + the_hash_algo->rawsz * i))
return 0;
}
@@ -580,8 +580,8 @@ static struct pack_midx_entry *get_sorted_entries(struct multi_pack_index *m,
* Take only the first duplicate.
*/
for (cur_object = 0; cur_object < nr_fanout; cur_object++) {
- if (cur_object && !oidcmp(&entries_by_fanout[cur_object - 1].oid,
- &entries_by_fanout[cur_object].oid))
+ if (cur_object && oideq(&entries_by_fanout[cur_object - 1].oid,
+ &entries_by_fanout[cur_object].oid))
continue;
ALLOC_GROW(deduplicated_entries, *nr_objects + 1, alloc_objects);