def has_ref(git, ref):
    try:
        out = git("show-ref", "--verify", "--quiet", ref)
    except sh.ErrorReturnCode:
        return False
    return out.exit_code == 0
If the newly discovered contact is, in fact, already in the local
dataset/ETHPy150Open dimagi/commcare-hq/scripts/rebuildstaging.py/has_ref--crossover with--dataset/ETHPy150Open ntoll/p4p2p/test/dht/test_routingtable.py/TestRoutingTable.test_add_contact_with_blacklisted_contact