FetchIntoObjectPool may fail due to D/F conflict of existing and new references
FetchIntoObjectPool may fail when there exists a reference in the pool repository that is a prefix of a reference that gets fetched into the pool with the following error:
fetch into object pool: exit status 1, stderr: \"error: cannot lock ref 'refs/remotes/origin/heads/pks/test': 'refs/remotes/origin/heads/pks' exists; cannot create 'refs/remotes/origin/heads/pks/test'\\n\"
The root cause is that there is a D/F conflict between old and new reference, and because we don't use --prune
for the fetch we won't ever clean up the old reference. We'll fail to ever recover from this situation until the reference is deleted in the repository we're fetching from and thus the pool repository will grow more and more inefficient over time.