commit: allow lookup_commit to handle arbitrary repositories