libgit2 / libgit2/libgit2sharp
repo.Network.ListReferences(remote) throwing exception "this remote has never connected" intermittently
Nessuno ha ancora preso questa issue.
- Lingua principale
- C#
- Stelle
- 3.5k
- Fork
- 925
- Metriche di merge delle PR
- Nessuna PR unita negli ultimi 30g
Descrizione
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.
Guida per i contributori
Apri la guida per i contributori
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Direzione di ricerca
Inizia con Network.ListReferences(Remote), ListReferencesInternal e la chiamata a git_remote_ls mostrata nello stack trace. Riproduci la prima chiamata e quelle successive utilizzando l’esempio fornito, quindi traccia lo stato intermittente del remote; il lavoro è concluso quando la causa è stata identificata e il problema dispone di un test di regressione o di una risoluzione chiaramente documentata.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Valutazione
- Stack tecnologico
- csharp, git
- Ambito
- networking
- Tipo di issue
- Bug
- Difficoltà
- 4/5
- Tempo stimato
- 3-5 giorni
- Stato di attività
- Ferma
- Chiarezza
- Da chiarire
- Idoneità per principianti
- 35/100