Hacktoberfest 2026: die Issues, die Maintainer für den Oktober markiert haben – offen und einsteigerfreundlich. Hacktoberfest-Issues durchsuchen

flaky repo.reset() behavior

Offen
#1,059 1 Kommentar 0 Reaktionen 0 zugewiesene Personen Auf GitHub ansehen

Dieses Issue hat noch niemand übernommen.

Bewertung

Schwierigkeit
4/5
Geschätzter Aufwand
3-5 Tage
Anfängerfreundlichkeit
35/100
Issue-Typ
Bug
Klarheit
Muss geklärt werden
Aktivitätsstatus
Veraltet
Tech-Stack
git, python
Bereich
devtools

Rechercherichtung

Beginne damit, die gemeldete CI-Sequenz mit pygit2 1.2.0 zu reproduzieren: Ändere eine Datei in einem Nicht-Bare-Repository und committe sie, rufe repo.reset() mit GIT_RESET_HARD auf, erstelle anschließend ein neues Repository und vergleiche repo.status() mit repo.diff(). Abgeschlossen ist die Untersuchung, wenn festgestellt wurde, ob das sporadische Ergebnis WT_MODIFIED von pygit2 oder libgit2 stammt, und die Ursache oder ein bestätigter Lösungsweg dokumentiert ist.

Vom Indexierungsmodell aus dem Issue-Text verfasst.

Beschreibung

This issue is about repo.reset() not seeming to work reliably 100% of the time.

I have some CI tests that modify a file in a non-bare repo, commit the change to a branch, and then call repo.reset() with GIT_RESET_HARD to restore to a different commit. After calling reset, to confirm that the reset was successful, the test creates a new Repository object and checks the repository's status using repo.status(). Occasionally (but very rarely), the status check comes back showing the original file still as WT_MODIFIED. A subsequent call to repo.diff() confirms the difference in the file. Is there something pygit2 is or isn't doing that could cause reset() to behave flakily like this? Or is libgit2 the more likely culprit?

This is using pygit2 1.2.0. I can try upgrading, but is there a reason to think this would be fixed in a newer version (e.g. a known issue that was fixed)? I haven't found anything like this in pygit2 or libgit2's issue tracker or release notes.

Vorherrschende Sprache
Python
Sterne
1.7k
Forks
408
Ø Merge
2 T. 57 Min.
Gemergte PRs (30 T.)
7

Beitragsleitfaden

Beitragsleitfaden öffnen

Erste Schritte

  1. Lesen Sie das ganze Issue und danach den Beitragsleitfaden des Projekts.
  2. Schreiben Sie ins Issue, dass Sie es übernehmen — das erspart doppelte Arbeit.
  3. Forken Sie das Repository und arbeiten Sie in einem Branch.
  4. Öffnen Sie einen Pull Request, der die Issue-Nummer nennt.

Mehr aus libgit2/pygit2

Alle Issues in libgit2/pygit2

Ähnliche Issues

Weitere Issues zu Python

Neue Issues direkt in Ihr Postfach

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