pygit2 icon indicating copy to clipboard operation
pygit2 copied to clipboard

Apply Function on Repository Fails on blank lines

Open fizzerle opened this issue 4 years ago • 0 comments

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.

fizzerle avatar Nov 09 '21 07:11 fizzerle