libgit2 / libgit2/pygit2

Apply Function on Repository Fails on blank lines

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

Dieses Issue hat noch niemand übernommen.

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

Beschreibung

The apply Function of the Repository Class fails if a diff contains a blank line with the Error = "Error: _pygit2.GitError: hunk at line ... did not apply"

To make it more clear. The hunk

   -    this is a
   -    test
   -
repo.apply(diff,pygit2.GIT_APPLY_LOCATION_INDEX)

has a blank last line that is removed. This hunk fails when applied.

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

Start at the Repository.apply entry point and reproduce the shown diff containing a blank final line with repo.apply(diff, pygit2.GIT_APPLY_LOCATION_INDEX). Done means this hunk applies successfully without the reported _pygit2.GitError.

Vom Indexierungsmodell aus dem Issue-Text verfasst.

Bewertung

Tech-Stack
git, python
Bereich
api
Issue-Typ
Bug
Schwierigkeit
3/5
Geschätzter Aufwand
1-2 Tage
Aktivitätsstatus
Veraltet
Klarheit
Größtenteils klar
Anfängerfreundlichkeit
45/100

Neue Issues direkt in Ihr Postfach

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