libgit2 / libgit2/libgit2sharp

Not seeing any branches, can't create branch

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

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

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

説明

I am running into the following error when i try to create a branch...

LibGit2Sharp.NotFoundException: revspec 'master' not found
   at LibGit2Sharp.Core.Ensure.HandleError(Int32 result)
   at LibGit2Sharp.Core.Proxy.git_annotated_commit_from_revspec(RepositoryHandle repo, String revspec)
   at LibGit2Sharp.Core.Proxy.git_branch_create_from_annotated(RepositoryHandle repo, String branch_name, String targetIdentifier, Boolean force)
   at LibGit2Sharp.BranchCollection.Add(String name, String committish, Boolean allowOverwrite)
   at LibGit2Sharp.BranchCollection.Add(String name, String committish)
   at LibGit2Sharp.RepositoryExtensions.CreateBranch(IRepository repository, String branchName)
   at EncompassSettingsExport.GitWriter..ctor(String PathToRepo, Signature Signature, CredentialsHandler credentialsHandler, String Branch, String SupplimentalPath, ILogger logger, Boolean purgeDirectory) in C:\Users\barnao\Downloads\EncompassSettingsExport2\EncompassSettingsExport\EncompassSettingsExport\GitWriter.cs:line 52
   at EncompassSettingsExport.Program.<Run>d__1.MoveNext() in C:\Users\barnao\Downloads\EncompassSettingsExport2\EncompassSettingsExport\EncompassSettingsExport\Program.cs:line 71
Finished! Press any key to exit...

The line of code that produces this error is

brnch = repo.CreateBranch(Branch)

Where Branch is just a string like "test-brnch" and repo is a Repository object i've already created.

I am checking to make sure i can see my repo here (it is a private non-local repo)

Repository.IsValid(PathToRepo)

and this returns true.

I create my repo here...

repo = new Repository(PathToRepo);

However i've noticed that when i call

repo.Branches.Count();

This return 0 even though i do have a few branches in my repo

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

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

はじめの一歩

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

調査の方向性

EncompassSettingsExport.GitWriter.cs の 52 行目と Program.cs の 71 行目から始め、続いて Repository のセットアップと repo.Branches.Count() の結果を調査します。説明されているプライベートリポジトリに対するブランチ作成の試行を再現し、既存のブランチが列挙されるか、また CreateBranch が成功するかを確認します。プロジェクトに回帰テストが用意されている場合は、該当する失敗または修正を回帰テストとともに記録します。

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

評価

技術スタック
csharp, git
領域
devtools
issue の種類
バグ
難易度
3/5
見積もり時間
1〜2日
活発さ
停滞
明瞭さ
おおむね明確
初心者へのやさしさ
35/100

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

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