Git fsck: duplicateEntries: contains duplicate file entries - cannot push to gitlab

We have a big git repository, which I want to push to a self-hosted gitlab instance.
The problem is that the gitlab remote does not let me push my repo:

git push --mirror https://mygitlab/xy/myrepo.git

...
remote: error: object c05ac7f76dcd3e8fb3b7faf7aab9b7a855647867: 
duplicateEntries: contains duplicate file entries
remote: fatal: fsck error in packed object    

git fsck confirms that there are tree objects with duplicate entries:

git ls-tree c05ac7f76dcd3e8fb3b7faf7aab9b7a855647867

100644 blob c233c88b192acfc20548d9d9f0c81c48c6a05a66    fileA.cs
100644 blob 5d6096cb75d27780cdf6da8a3b4d357515f004e0    fileB.cs
100644 blob 5d6096cb75d27780cdf6da8a3b4d357515f004e0    fileB.cs
100644 blob d2a4248bcda39c0dc3827b495f7751b7cc06c816    fileC.xaml

Is there any way to fix the repo? The commit that introduced that problem is over half a year old, and at that time gitlab did not notice us about any problems. Just now that I wanted to mirror the repo before cleaning it up a little I am not able to push the mirror.

Bit late now, but git - Tree contains duplicate file entries - Stack Overflow seems to contain relevant advice.