libgit2 / libgit2/libgit2sharp
repo.Network.ListReferences(remote) throwing exception "this remote has never connected" intermittently
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
Calling repo.Network.ListReferences(remote) throws exception "this remote has never connected" intermittently. This is how I have called it ... if it matters
string localRepoPath = "path to cloned folder";
string remoteName = "origin";
using (Repository repo = new Repository(localRepoPath))
{
remoteName = repo.Network.Remotes.FirstOrDefault()?.Name ?? remoteName;
Remote remote = repo.Network.Remotes[remoteName];
List<Reference> references = repo.Network.ListReferences(remote).ToList();
// some more code logic here
}
So am calling the overload of ListReferences(Remote remote) which essentially calls ListReferencesInternal(string url, CredentialsHandler credentialsProvider) passing null to CredentialsHandler. Should this be an issue? Don't think so since it's working in second try or so. Relevant exception stack trace below
{
"Depth": 1,
"ClassName": "",
"Message": "this remote has never connected",
"Source": "LibGit2Sharp",
"StackTraceString": " at LibGit2Sharp.Core.Ensure.HandleError(Int32 result)\r\n at LibGit2Sharp.Core.Proxy.git_remote_ls(Repository repository, RemoteHandle remote)\r\n at LibGit2Sharp.Network.ListReferencesInternal(String url, CredentialsHandler credentialsProvider)\r\n
Please suggest, what's wrong is going on (Or) if you need further information from my end.
Found this existing issue https://github.com/libgit2/libgit2sharp/issues/1504 but am not passing any credential, and it's a public repo which am trying to access.
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 por Network.ListReferences(Remote), ListReferencesInternal e a chamada de git_remote_ls mostrada no stack trace. Reproduza a primeira chamada e as subsequentes usando o exemplo fornecido e, em seguida, rastreie o estado intermitente do remote; considera-se concluído quando a causa for identificada e a falha tiver um teste de regressão ou uma resolução claramente documentada.
Escrita pelo modelo de indexação a partir do texto da issue.
Avaliação
- Stack de tecnologia
- csharp, git
- Domínio
- networking
- Tipo de issue
- Bug
- Dificuldade
- 4/5
- Tempo estimado
- 3-5 dias
- Status de atividade
- Estagnada
- Clareza
- Precisa de esclarecimento
- Facilidade para iniciantes
- 35/100