libgit2 / libgit2/libgit2sharp
repo.Network.ListReferences(remote) throwing exception "this remote has never connected" intermittently
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
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.
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 Network.ListReferences(Remote), ListReferencesInternal y la llamada a git_remote_ls que se muestra en el stack trace. Reproduce la primera llamada y las posteriores utilizando el ejemplo proporcionado y, a continuación, rastrea el estado intermitente del remote; se considera terminado cuando se haya identificado la causa y el fallo tenga una prueba de regresión o una resolución claramente documentada.
Escrito por el modelo de indexación a partir del texto del issue.
Evaluación
- Stack tecnológico
- csharp, git
- Área
- networking
- Tipo de issue
- Error
- Dificultad
- 4/5
- Tiempo estimado
- 3-5 días
- Estado de actividad
- Estancado
- Claridad
- Necesita aclaración
- Aptitud para principiantes
- 35/100