checkout: check return value of resolve_refdup before using hash