libgit2 / libgit2/libgit2sharp
Checkout with modified but not dirty submodules
Nadie ha tomado este issue todavía.
- Lenguaje dominante
- C#
- Estrellas
- 3.5k
- Forks
- 925
- Métricas de merge de PR
- Sin PR fusionados en 30 d
Descripción
Version : vNext & master
Native : 1.0.72 - git2-4d6362b
There are two types of modified submodules, one that shows as modified due to a index pointer(SHA) mismatch, and one due to the submodule's content actually being changed/modified. Git knows the different and does not require a 'checkout -force'. or a 'git submodule update' on each submodule before doing a checkout, but libgit2sharp/libgit2 does require the checkout to be forced.
Is this the intended/designed result with modified/index and modified/dirty submodules? Or a bug?
It is a thrown exception from libgit2, so I coded around it with a exception bound helper extension to determine if the errors are related to submodules and to go determine if just the index changed and thus it is safe to flip the force option on or if the submodules are dirty and what are the 'real' exceptions within each submodule and throw those. It just seems like this should be one in one the libraries like it is within git (IMHO)...
This will not be a forced git checkout:
diff --git a/external/cecil b/external/cecil
index 33d50b8..fc76b93 160000
--- a/external/cecil
+++ b/external/cecil
@@ -1 +1 @@
-Subproject commit 33d50b874fd527118bc361d83de3d494e8bb55e1
+Subproject commit fc76b93e3e0064b2d751796878f9cbe88df1d5f4
This would be a forced git checkout:
diff --git a/external/rx b/external/rx
index b29a4b0..17e8477 160000
--- a/external/rx
+++ b/external/rx
@@ -1 +1 @@
-Subproject commit b29a4b0fda609e0af33ff54ed13652b6ccf0e05e
-Subproject commit b29a4b0fda609e0af33ff54ed13652b6ccf0e05e-dirty
Guía de contribución
Primeros pasos
- Lee el issue completo y luego la guía de contribución del proyecto.
- Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
- Haz un fork del repositorio y trabaja en una rama.
- Abre un pull request que haga referencia al número del issue.
Línea de trabajo
No se especifica ningún archivo fuente ni ninguna prueba. Empieza reproduciendo el comportamiento de checkout con un submódulo cuyo puntero del índice difiere y otro cuyo contenido está dirty, y luego sigue el manejo de errores de checkout de libgit2sharp. El trabajo está terminado cuando los cambios que solo afectan al puntero no requieren force, mientras los submódulos dirty siguen protegidos y se conservan sus errores subyacentes.
Escrito por el modelo de indexación a partir del texto del issue.
Evaluación
- Stack tecnológico
- csharp, git
- Área
- devtools
- Tipo de issue
- Error
- Dificultad
- 4/5
- Tiempo estimado
- 3-5 días
- Estado de actividad
- Estancado
- Claridad
- Bastante claro
- Aptitud para principiantes
- 38/100