libgit2 / libgit2/libgit2sharp

repo.Network.ListReferences(remote) throwing exception "this remote has never connected" intermittently

オープン
#1,668 コメント 0 件 リアクション 2 件 担当者 0 名 GitHub で見る

まだ誰も着手していません。

主要言語
C#
スター
3.5k
フォーク
925
PR マージ指標
30日以内にマージされた PR はありません

説明

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.

コントリビューションガイド

コントリビューションガイドを開く

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

調査の方向性

Network.ListReferences(Remote)、ListReferencesInternal、およびスタックトレースに示されている git_remote_ls 呼び出しから始めます。提供されたサンプルを使って最初の呼び出しとその後の呼び出しを再現し、続いて断続的な remote の状態を追跡します。原因が特定され、失敗に対する回帰テストまたは明確に文書化された解決策が用意されていれば完了です。

索引モデルが issue の本文から書いたものです。

評価

技術スタック
csharp, git
領域
networking
issue の種類
バグ
難易度
4/5
見積もり時間
3〜5日
活発さ
停滞
明瞭さ
説明が足りない
初心者へのやさしさ
35/100

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。