Crash when multiple pack-files contain the same object #8
Labels
Comments
|
Do you know how to reproduce this? (i.e. how to create such a repo) Thanks |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Apparently multiple pack files can contain the same object hash. This error message will be shown:
Unhandled Exception: System.ArgumentException: An item with the same key has already been added. Key: 0b1bac8acae82a0d91133244c61400a3e409ce56 at System.Collections.Generic.Dictionary\2.TryInsert(TKey key, TValue value, InsertionBehavior behavior) at GitRewrite.IO.PackReader.BuildPackFileDictionary(IEnumerable1 packFiles) in C:\VCS\GitRewrite\GitRewrite\IO\PackReader.cs:line 87 at GitRewrite.Program.Main(String[] args) in C:\VCS\GitRewrite\GitRewrite\Program.cs:line 24It is most likely not fixed by just ignoring already this error (not adding the file to the dictionary), as I think the diff restoring algorithm always operates on only one packfile at a time.
The workaround for this is running a
git repackwith the-aswitch before running GitRewrite. Please see the documentation of git repack: https://git-scm.com/docs/git-repackThe text was updated successfully, but these errors were encountered: