summaryrefslogtreecommitdiff
path: root/remote.c
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2018-09-17 13:53:57 -0700
committerJunio C Hamano <gitster@pobox.com>2018-09-17 13:53:57 -0700
commit769af0fd9ea0b4de172b51ae4b9ea41b57c02fd3 (patch)
tree524c7d9759fb9deae7b82581aa28fc8bc38265f6 /remote.c
parentd88949d86eddb62acbc85c16c97587db043d05b1 (diff)
parentd9f62dfa0ddc31bdad93054acca9fd42ca781f7f (diff)
downloadgit-769af0fd9ea0b4de172b51ae4b9ea41b57c02fd3.tar.gz
Merge branch 'jk/cocci'
spatch transformation to replace boolean uses of !hashcmp() to newly introduced oideq() is added, and applied, to regain performance lost due to support of multiple hash algorithms. * jk/cocci: show_dirstat: simplify same-content check read-cache: use oideq() in ce_compare functions convert hashmap comparison functions to oideq() convert "hashcmp() != 0" to "!hasheq()" convert "oidcmp() != 0" to "!oideq()" convert "hashcmp() == 0" to hasheq() convert "oidcmp() == 0" to oideq() introduce hasheq() and oideq() coccinelle: use <...> for function exclusion
Diffstat (limited to 'remote.c')
-rw-r--r--remote.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/remote.c b/remote.c
index 9a07951769..682f2a01f9 100644
--- a/remote.c
+++ b/remote.c
@@ -1389,7 +1389,7 @@ void set_ref_status_for_push(struct ref *remote_refs, int send_mirror,
ref->deletion = is_null_oid(&ref->new_oid);
if (!ref->deletion &&
- !oidcmp(&ref->old_oid, &ref->new_oid)) {
+ oideq(&ref->old_oid, &ref->new_oid)) {
ref->status = REF_STATUS_UPTODATE;
continue;
}
@@ -1404,7 +1404,7 @@ void set_ref_status_for_push(struct ref *remote_refs, int send_mirror,
* branch.
*/
if (ref->expect_old_sha1) {
- if (oidcmp(&ref->old_oid, &ref->old_oid_expect))
+ if (!oideq(&ref->old_oid, &ref->old_oid_expect))
reject_reason = REF_STATUS_REJECT_STALE;
else
/* If the ref isn't stale then force the update. */
@@ -2001,7 +2001,7 @@ struct ref *guess_remote_head(const struct ref *head,
/* If refs/heads/master could be right, it is. */
if (!all) {
r = find_ref_by_name(refs, "refs/heads/master");
- if (r && !oidcmp(&r->old_oid, &head->old_oid))
+ if (r && oideq(&r->old_oid, &head->old_oid))
return copy_ref(r);
}
@@ -2009,7 +2009,7 @@ struct ref *guess_remote_head(const struct ref *head,
for (r = refs; r; r = r->next) {
if (r != head &&
starts_with(r->name, "refs/heads/") &&
- !oidcmp(&r->old_oid, &head->old_oid)) {
+ oideq(&r->old_oid, &head->old_oid)) {
*tail = copy_ref(r);
tail = &((*tail)->next);
if (!all)