Corrupted branch that corrupts source code?

This is the most obscure, odd behavior I’ve ever seen on GitHub and I am completely stuck.

Here is the repo where the following happened.

The “corrupted” branch is refactor-ci-cd. When you try to even dotnet restore the solution, it breaks with the following error:

Microsoft.IO.RecyclableMemoryStream.csproj(1,1): error MSB4025: The project file could not be loaded. Data at the root level is invalid. Line 1, position 1.

Steps to reproduce:

  1. Clone repo
  2. Checkout branch refactor-ci-cd
  3. Run dotnet restore in root folder

Troubleshooting attempts and discoveries:

I copy/paste verbatim the code changes from this branch to a fresh branch and the dotnet restore works as it should. The branch is refactor-ci-cd-2. (the master branch also has those changes copy/paste in it and also works fine)

I copy/paste the original code of each of three files that were changed from the default branch on the original repo to the refactor-ci-cd on my fork → the same error occurs.

I have not changed names, folders, paths etc.

The machine on which the command is execute don’t seem to matter, because the behavior is exactly the same locally, on a GHA runner and in a container.

My only conclusion is that the branch has somehow been corrupted and it messes with the path structure.

But is that even possible ?

Are you sure that refactor-ci-cd-2 is “[…] the code changes from this branch […]” because if we use the branch comparison feature we can see that there’s a substantial number of differences between refactor-ci-cd-2 and refactor-ci-cd: feature/refactor-ci-cd…aleks-ivanov:feature/refactor-ci-cd-2

Showing 6 changed files with 173 additions and 94 deletions .

Yes, these are completely unrelated changes that came from an update from the default branch of the original repo.

If you look at these two files in both branches, you will see they are identical: