summaryrefslogtreecommitdiff
path: root/builtin/fetch.c
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2018-09-17 20:53:57 (GMT)
committerJunio C Hamano <gitster@pobox.com>2018-09-17 20:53:57 (GMT)
commit769af0fd9ea0b4de172b51ae4b9ea41b57c02fd3 (patch)
tree524c7d9759fb9deae7b82581aa28fc8bc38265f6 /builtin/fetch.c
parentd88949d86eddb62acbc85c16c97587db043d05b1 (diff)
parentd9f62dfa0ddc31bdad93054acca9fd42ca781f7f (diff)
downloadgit-769af0fd9ea0b4de172b51ae4b9ea41b57c02fd3.zip
git-769af0fd9ea0b4de172b51ae4b9ea41b57c02fd3.tar.gz
git-769af0fd9ea0b4de172b51ae4b9ea41b57c02fd3.tar.bz2
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 'builtin/fetch.c')
-rw-r--r--builtin/fetch.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/builtin/fetch.c b/builtin/fetch.c
index eed15c7..dc0931f 100644
--- a/builtin/fetch.c
+++ b/builtin/fetch.c
@@ -239,7 +239,7 @@ static int will_fetch(struct ref **head, const unsigned char *sha1)
{
struct ref *rm = *head;
while (rm) {
- if (!hashcmp(rm->old_oid.hash, sha1))
+ if (hasheq(rm->old_oid.hash, sha1))
return 1;
rm = rm->next;
}
@@ -508,7 +508,7 @@ static void adjust_refcol_width(const struct ref *ref)
int max, rlen, llen, len;
/* uptodate lines are only shown on high verbosity level */
- if (!verbosity && !oidcmp(&ref->peer_ref->old_oid, &ref->old_oid))
+ if (!verbosity && oideq(&ref->peer_ref->old_oid, &ref->old_oid))
return;
max = term_columns();
@@ -645,7 +645,7 @@ static int update_local_ref(struct ref *ref,
if (type < 0)
die(_("object %s not found"), oid_to_hex(&ref->new_oid));
- if (!oidcmp(&ref->old_oid, &ref->new_oid)) {
+ if (oideq(&ref->old_oid, &ref->new_oid)) {
if (verbosity > 0)
format_display(display, '=', _("[up to date]"), NULL,
remote, pretty_ref, summary_width);