libgit2 / libgit2/libgit2sharp

LibGit2Sharp.LibGit2SharpException, additional info code and category changed to int

Offen
#1,358 0 Kommentare 0 Reaktionen 0 zugewiesene Personen Auf GitHub ansehen

Dieses Issue hat noch niemand übernommen.

Vorherrschende Sprache
C#
Sterne
3.5k
Forks
925
PR-Merge-Kennzahlen
Keine gemergten PRs in 30 T.

Beschreibung

The following is taken from a log file:

LibGit2Sharp.LibGit2SharpException: Failed to map 'false?'
at LibGit2Sharp.Core.Ensure.HandleError(Int32 result)
at LibGit2Sharp.Core.Proxy.git_checkout_tree(RepositorySafeHandle repo, ObjectId treeId, GitCheckoutOpts& opts)
at LibGit2Sharp.Repository.CheckoutTree(Tree tree, IList`1 paths, IConvertableToGitCheckoutOpts opts)
at LibGit2Sharp.Repository.Checkout(Tree tree, CheckoutOptions checkoutOptions, String refLogHeadSpec)
at LibGit2Sharp.Repository.Checkout(Branch branch, CheckoutOptions options)
Additional Data:
libgit2.code: -1
libgit2.category: 7

As you can see, both code and category are numbers here. But internally they are enums, it would be a lot easier to read this if the enums where used in the additional info, instead of the int.

LibGit2Sharp/LibGit2SharpException.cs
affected lines 58,59, where the enum is cast to int.

Beitragsleitfaden

Beitragsleitfaden öffnen

Erste Schritte

  1. Lies das ganze Issue und danach den Beitragsleitfaden des Projekts.
  2. Schreib ins Issue, dass du es übernimmst — das erspart doppelte Arbeit.
  3. Forke das Repository und arbeite in einem Branch.
  4. Öffne einen Pull Request, der die Issue-Nummer nennt.

Rechercherichtung

Öffne LibGit2Sharp/LibGit2SharpException.cs und untersuche die Zeilen 58–59, in denen der libgit2-Code und die Kategorie-enums für zusätzliche Informationen in int umgewandelt werden. Ersetze die numerische Ausgabe durch die entsprechenden enum-Werte und überprüfe anschließend, dass die Exception-Daten lesbare enum-Namen statt Ganzzahlen anzeigen.

Vom Indexierungsmodell aus dem Issue-Text verfasst.

Bewertung

Tech-Stack
csharp, git
Bereich
backend
Issue-Typ
Feature
Schwierigkeit
1/5
Geschätzter Aufwand
Unter einer Stunde
Aktivitätsstatus
Veraltet
Klarheit
Klar beschrieben
Anfängerfreundlichkeit
35/100

Neue Issues direkt in Ihr Postfach

Eine kurze Übersicht über anfängerfreundliche GitHub-Issues.