Skip to content
  • Jeff King's avatar
    convert "hashcmp() == 0" to hasheq() · e3ff0683
    Jeff King authored and Junio C Hamano's avatar Junio C Hamano committed
    
    
    This is the partner patch to the previous one, but covering
    the "hash" variants instead of "oid".  Note that our
    coccinelle rule is slightly more complex to avoid triggering
    the call in hasheq().
    
    I didn't bother to add a new rule to convert:
    
      - hasheq(E1->hash, E2->hash)
      + oideq(E1, E2)
    
    Since these are new functions, there won't be any such
    existing callers. And since most of the code is already
    using oideq, we're not likely to introduce new ones.
    
    We might still see "!hashcmp(E1->hash, E2->hash)" from topics
    in flight. But because our new rule comes after the existing
    ones, that should first get converted to "!oidcmp(E1, E2)"
    and then to "oideq(E1, E2)".
    
    Signed-off-by: default avatarJeff King <peff@peff.net>
    Signed-off-by: default avatarJunio C Hamano <gitster@pobox.com>
    e3ff0683