libgit2 / libgit2/libgit2sharp
Exception: "An item with the same key has already been added" when comparing commits
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
I get ArgumentException when comparing two commits from https://github.com/shageman/the_next_big_thing with v.0.23.1.0
System.ArgumentException:` An item with the same key has already been added. at System.ThrowHelper.ThrowArgumentException(ExceptionResource resource) at System.Collections.Generic.Dictionary`2.Insert(TKey key, TValue value, Boolean add) at System.Collections.Generic.Dictionary`2.Add(TKey key, TValue value) at LibGit2Sharp.Patch.AddFileChange(git_diff_delta* delta) in c:\Git\LibGit2Sharp-2\LibGit2Sharp\Patch.cs:line 54 at LibGit2Sharp.Patch..ctor(DiffHandle diff) in c:\Git\LibGit2Sharp-2\LibGit2Sharp\Patch.cs:line 43 at LibGit2Sharp.Diff.<.cctor>b__1b(DiffHandle diff) in c:\Git\LibGit2Sharp-2\LibGit2Sharp\Diff.cs:line 104 at LibGit2Sharp.Diff.BuildDiffResult[T](DiffHandle diff) in c:\Git\LibGit2Sharp-2\LibGit2Sharp\Diff.cs:line 120 at LibGit2Sharp.Diff.Compare[T](Tree oldTree, Tree newTree, IEnumerable`1 paths, ExplicitPathsOptions explicitPathsOptions, CompareOptions compareOptions) in c:\Git\LibGit2Sharp-2\LibGit2Sharp\Diff.cs:line 253 at LibGit2Sharp.Diff.Compare[T](Tree oldTree, Tree newTree) in c:\Git\LibGit2Sharp-2\LibGit2Sharp\Diff.cs:line 157
The code I'am using:
this.repository.Diff.Compare<Patch>(commitB.Tree, commitA.Tree);
commitA: a9a82df96ab1f73c69b2668b91eda31e672bbf98 Move rails application back to root to make heroku deployment work again
commitB: ede0b0c359d5af516889563bebafd51b7f43115a Gemnasium doesn't recognize Gemfile when its not in the root. Let's try symlinks
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
Comienza con LibGit2Sharp/Patch.cs en AddFileChange y revisa la ruta de llamadas desde Diff.cs durante Diff.Compare. Reproduce la comparación usando los commits a9a82df96ab1f73c69b2668b91eda31e672bbf98 y ede0b0c359d5af516889563bebafd51b7f43115a. La tarea estará terminada cuando esta comparación ya no lance la ArgumentException por clave duplicada y devuelva los cambios esperados del patch.
Escrito por el modelo de indexación a partir del texto del issue.
Evaluación
- Stack tecnológico
- csharp, git
- Área
- backend
- Tipo de issue
- Error
- Dificultad
- 3/5
- Tiempo estimado
- 1-2 días
- Estado de actividad
- Estancado
- Claridad
- Bastante claro
- Aptitud para principiantes
- 35/100