libgit2 / libgit2/libgit2sharp
Commands.Stage() fails with a submodule
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
- Add a submodule to a Git repository like
git submodule add ../test-module test-module - Change the commit of the submodule like
cd test-module; git checkout -b branch-name - Try to stage the submodule using libgit2sharp with
Commands.Stage("*")or withCommands.Stage("test-module")
Expected behavior
The submodule change should be staged.
Actual behavior
An exception is thrown because git_index_add_bypath() failed because the path is invalid: test-module/
Commands.Stage() adds a slash at the end of the submodule name it passes to git_index_add_bypath which causes it to fail. git_index_add_bypath works fine passing it test-module directly with repo.Index.Add("test-module") (which is a workaround I'll use for now).
Version of LibGit2Sharp (release number or SHA1)
LibGit2Sharp 0.26.2
Operating system(s) tested; .NET runtime tested
.NET Framework 4.7.2 on Windows 10
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 pelo ponto de entrada Commands.Stage e reproduza o caso de submódulo descrito com Commands.Stage("*") e Commands.Stage("test-module"). Compare o tratamento de caminhos dele com repo.Index.Add("test-module"), que é relatado como workaround. Considera-se concluído quando for possível fazer o stage do submódulo alterado sem o erro de caminho com barra no final.
Escrita pelo modelo de indexação a partir do texto da issue.
Avaliação
- Stack de tecnologia
- csharp, git
- Domínio
- tooling
- Tipo de issue
- Bug
- Dificuldade
- 3/5
- Tempo estimado
- 1-2 dias
- Status de atividade
- Estagnada
- Clareza
- Claramente especificada
- Facilidade para iniciantes
- 45/100