sha1-lookup: handle duplicate keys with GIT_USE_LOOKUP