Bug: Files vanish when deleting current branch in Git plugin

Abierto
#278 0 comentarios 0 reacciones 0 asignados Ver en GitHub

Nadie ha tomado este issue todavía.

Evaluación

Dificultad
3/5
Tiempo estimado
1-2 días
Aptitud para principiantes
45/100
Tipo de issue
Error
Claridad
Bastante claro
Estado de actividad
Estancado
Stack tecnológico
cpp, git, godot
Área
devtools

Línea de trabajo

Comienza en la acción "Remove Branch" del Commit Dock y reproduce la secuencia de crear, seleccionar y eliminar la rama actual en Godot 4.3 con Git plugin 3.1.1. Rastrea cómo se gestiona la rama activa durante la eliminación y, a continuación, verifica que la UI impide eliminar la rama seleccionada y que los archivos siguen siendo recuperables después de las operaciones con ramas.

Escrito por el modelo de indexación a partir del texto del issue.

Descripción

bug

Environment where the phenomenon occurred

GodotEngine v4.3.stable.official [77dcf97d8]
Git plugin v3.1.1
Windows10 Home (64bit)

Steps taken and the problem encountered

Using the "Create New Branch" option in the bottom-right menu of the Commit Dock, I created a branch named publish.

The selected branch in the bottom-left of the Commit Dock automatically switched from master to publish.

I committed several files to the publish branch.

Using the "Remove Branch" option in the bottom-right menu of the Commit Dock, I deleted the currently selected publish branch.

Godot4 Git plugin remove branch probrem #1

Immediately afterward, two error dialogs were displayed, and some of the files I had just committed disappeared.
The first dialog displayed the message: "Cannot open file 'filename.tscn'. The file may have been moved or deleted."
The second dialog displayed the message: "Cannot load due to a missing dependency: filename.gd."

When I closed the dialogs, the editor forcibly closed itself.

Even after restarting the editor, the files remained missing, and errors related to the missing files were displayed.

The deleted files were not found in the recycle bin either.

Godot4 Git plugin remove branch probrem #2

Workaround

If you select a different branch (e.g., master) and then delete the publish branch, the branch is removed successfully without errors.

Request

Please prevent the deletion of the currently selected branch.
For example, by excluding the currently selected branch from the "Remove Branch" list or by displaying a dialog to interrupt the process.

The Issue is Not File Deletion, but the Ability to Delete the Currently Selected Branch

(Added on 2025/04/23)

When switching branches, it was confirmed that TortoiseGit also deletes files or folders that were tracked in the previous branch (e.g., publish) but not in the branch after switching (e.g., master).
However, these deleted files or folders can be restored by switching back to the original branch (e.g., publish).

master branch  
 a.txt  

publish branch  
 a.txt  
 b.txt  

File states during branch switching  

publish -> master   -> publish  
a.txt    -> a.txt       -> a.txt  
b.txt    -> (deleted) -> b.txt  

The main point of this issue is not that files or folders were deleted when the selected branch (e.g., publish) was removed and the remaining branch (e.g., master) was automatically switched to.
Instead, the point is that after the original branch (e.g., publish) was deleted, the files or folders cannot be restored.

File states when the selected branch is deleted, and it is automatically switched to the `master` branch  

publish -> master   -> publish (deleted)  
a.txt    -> a.txt       -> Cannot switch back.  
b.txt    -> (deleted) -> Cannot switch back.  

Therefore, it would be safer if the list displayed in the "Remove branch" option prevents selecting the currently active branch (e.g., publish).

That is all for my report.

This text was translated from Japanese to English using Windows 10 Copilot.
It was then retranslated back into Japanese with Google Translate to verify its accuracy before posting.

Lenguaje dominante
C++
Estrellas
966
Forks
100
Métricas de merge de PR
Sin PR fusionados en 30 d

Preparar el entorno

Este proyecto no incluye contenedor de desarrollo, Dockerfile ni guía de contribución, así que la configuración corre por tu cuenta: empieza por su README y consulta nuestra guía para la primera contribución para los pasos generales.

Primeros pasos

  1. Lee el issue completo y luego la guía de contribución del proyecto.
  2. Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
  3. Haz un fork del repositorio y trabaja en una rama.
  4. Abre un pull request que haga referencia al número del issue.

Más de godotengine/godot-git-plugin

Todos los issues de godotengine/godot-git-plugin

Issues similares

Más issues de C++

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.