godotengine / godot-git-plugin

Git implementation of the VCS interface in Godot
MIT License
720 stars 75 forks source link

Godot crashes when staging a 'new' file, if file still 'exists' somewhere in the project #171

Open HStep20 opened 1 year ago

HStep20 commented 1 year ago

After doing some more testing from #170, I think Ive found what caused the initial engine crash.

While refactoring, I had moved some file around, and the committed all. It crashed. I used git to unstage the changes, and that brought Godot back to life.

In order to replicate the crash:

  1. Set up a new project with a scene and an empty folder.
  2. Stage and Commit your current state to git
  3. Add a Sprite 2d node to your scene, and add the godot.svg to it
  4. Move your scene and the sprite into the empty folder
  5. Stage the 'new files'

It should crash. Try to launch it again, and it should fail to start/crash.

Now, using the Git terminal (or vscode), navigate to the folder and undo your staged changes. Reopen godot, and your project, and it should launch fine.

  1. Stage and Commit ONLY the deleted/modified files
  2. Stage and Commit the 'new' files

You should see that the engine no longer crashes if staged/committed in this order. There is clearly something colliding with the refactored files that is causing the plugin to crash the engine if you try to stage files that exist in multiple places at once. It works if you 'remove' the files in a commit, and then add the files back in a second commit, but it doesn't work if you try to stage all the changes at once.