Fix concurrency bug in WithRef

Getting RevCommits can’t be done in parallel since #rev_commit uses a
shared instance of Repo.
Pass commit_id instead of RevCommit instance to snapshot factories