libgit2 / libgit2/libgit2sharp
Exception: "An item with the same key has already been added" while comparing commits
Ninguém assumiu esta issue ainda.
- Linguagem predominante
- C#
- Estrelas
- 3.5k
- Forks
- 925
- Métricas de merge de PRs
- Nenhum PR com merge em 30d
Descrição
Reproduction steps
repository.Diff.Compare<Patch>(commitB.Tree, commitA.Tree);
Expected behavior
patch
Actual behavior
"exception": "System.ArgumentException: An item with the same key has already been added. Key: tools/firmware-utils/src/bcm_tag.h\n at System.Collections.Generic.Dictionary`2.TryInsert(TKey key, TValue value, InsertionBehavior behavior)\n at System.Collections.Generic.Dictionary`2.Add(TKey key, TValue value)\n at LibGit2Sharp.Patch..ctor(DiffHandle diff)\n at LibGit2Sharp.Diff.u003cu003ec.u003c.cctoru003eb__36_0(DiffHandle diff)\n at LibGit2Sharp.Diff.BuildDiffResult[T](DiffHandle diff)\n at LibGit2Sharp.Diff.Compare[T](Tree oldTree, Tree newTree, IEnumerable`1 paths, ExplicitPathsOptions explicitPathsOptions, CompareOptions compareOptions)\n at
Version of LibGit2Sharp (release number or SHA1)
libgit2sharp/0.26.2
Operating system(s) tested; .NET runtime tested
ubuntu docker mcr.microsoft.com/dotnet/core/aspnet:3.1-bionic
Guia de contribuição
Primeiros passos
- Leia a issue inteira e depois o guia de contribuição do projeto.
- Comente na issue dizendo que vai assumir — evita que duas pessoas façam o mesmo trabalho.
- Faça um fork do repositório e trabalhe em uma branch.
- Abra um pull request que referencie o número da issue.
Direção de pesquisa
Comece reproduzindo repository.Diff.Compare< Patch >(commitB.Tree, commitA.Tree) com os commits informados e revise o stack trace passando por Diff.Compare e LibGit2Sharp.Patch. Inspecione como o caminho duplicado tools/firmware-utils/src/bcm_tag.h é tratado; considera-se concluído quando a comparação retorna um patch em vez de lançar a exceção de chave duplicada.
Escrita pelo modelo de indexação a partir do texto da issue.
Avaliação
- Stack de tecnologia
- csharp, git
- Domínio
- devtools
- Tipo de issue
- Bug
- Dificuldade
- 3/5
- Tempo estimado
- 1-2 dias
- Status de atividade
- Estagnada
- Clareza
- Precisa de esclarecimento
- Facilidade para iniciantes
- 25/100