libgit2 / libgit2/libgit2sharp
Pushing new branches does not set up tracking branch completely
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
When you push a local branch that does not exist on the remote (using the refspec overload), libgit2sharp automatically creates a tracking branch, but it does not set up the config for the local branch
i.e. the following config entries are missing:
branch.(branch_name).remote
branch.(branch_name).merge
Currently, I push a new branch like as follows:
string refspec = string.Format("{0}:{1}",
currentBranch.CanonicalName, currentBranch.CanonicalName);
repo.Network.Push(remote, refspec, handler, credentials);
repo.Branches.Update(repo.Head, delegate(BranchUpdater updater)
{
updater.Remote = remote.Name;
updater.UpstreamBranch = repo.Head.CanonicalName;
});
I feel like this should be simplified. Either by doing the BranchUpdater stuff in Push(), or by extending the Push(Branch, ...) overload to let it accept non-tracking branches and do the whole process.
I also did not find a test fixture covering that feature, so the intended behaviour should at least be specified.
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 lendo as sobrecargas de Push e o uso de BranchUpdater mostrados na issue; em seguida, inspecione os fixtures de teste de push existentes, pois a issue informa que nenhum deles cobre esse comportamento. O trabalho estará concluído quando o caminho de push compatível para uma nova branch estabelecer a configuração de branch.remote e branch.merge, com um teste especificando o comportamento pretendido.
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
- Razoavelmente clara
- Facilidade para iniciantes
- 38/100