libgit2 / libgit2/libgit2sharp
repo.Network.ListReferences(remote) throwing exception "this remote has never connected" intermittently
Personne n'a encore pris cette issue.
- Langage dominant
- C#
- Étoiles
- 3.5k
- Forks
- 925
- Métriques de merge des PR
- Aucune PR mergée en 30 j
Description
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.
Guide de contribution
Ouvrir le guide de contribution
Par où commencer
- Lisez l'issue en entier, puis le guide de contribution du projet.
- Signalez en commentaire que vous la prenez — cela évite que deux personnes fassent le même travail.
- Forkez le dépôt et travaillez sur une branche.
- Ouvrez une pull request qui référence le numéro de l'issue.
Piste de recherche
Commencez par Network.ListReferences(Remote), ListReferencesInternal et l’appel à git_remote_ls indiqué dans la stack trace. Reproduisez le premier appel et les appels suivants à l’aide de l’exemple fourni, puis suivez l’état intermittent du remote ; le travail est terminé lorsque la cause est identifiée et que l’échec dispose d’un test de régression ou d’une résolution clairement documentée.
Rédigé par le modèle d'indexation à partir du texte de l'issue.
Évaluation
- Stack technique
- csharp, git
- Domaine
- networking
- Type d'issue
- Bug
- Difficulté
- 4/5
- Temps estimé
- 3-5 jours
- Activité
- À l'abandon
- Clarté
- À clarifier
- Accessibilité débutants
- 35/100