libgit2 / libgit2/libgit2sharp
Not seeing any branches, can't create branch
Dieses Issue hat noch niemand übernommen.
- Vorherrschende Sprache
- C#
- Sterne
- 3.5k
- Forks
- 925
- PR-Merge-Kennzahlen
- Keine gemergten PRs in 30 T.
Beschreibung
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
Beitragsleitfaden
Erste Schritte
- Lies das ganze Issue und danach den Beitragsleitfaden des Projekts.
- Schreib ins Issue, dass du es übernimmst — das erspart doppelte Arbeit.
- Forke das Repository und arbeite in einem Branch.
- Öffne einen Pull Request, der die Issue-Nummer nennt.
Rechercherichtung
Beginne mit EncompassSettingsExport.GitWriter.cs Zeile 52 und Program.cs Zeile 71, untersuche anschließend das Repository-Setup und das Ergebnis von repo.Branches.Count(). Reproduziere den Versuch, einen Branch im beschriebenen privaten Repository zu erstellen, und überprüfe, ob vorhandene Branches aufgelistet werden und CreateBranch erfolgreich ist; dokumentiere den relevanten Fehler oder die Behebung mit einem Regressionstest, falls das Projekt einen solchen bereitstellt.
Vom Indexierungsmodell aus dem Issue-Text verfasst.
Bewertung
- Tech-Stack
- csharp, git
- Bereich
- devtools
- Issue-Typ
- Bug
- Schwierigkeit
- 3/5
- Geschätzter Aufwand
- 1-2 Tage
- Aktivitätsstatus
- Veraltet
- Klarheit
- Größtenteils klar
- Anfängerfreundlichkeit
- 35/100