You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The apply method of a Repository fails ungracefully when I give it anything other than a Diff object. Specifically, when I pass in a Patch, the assertion (repo && diff) fails, even though the documentation says apply can accept a diff or a patch. When I pass in a string, the application simply segfaults.
Repro:
from pygit2 import Repository
r = Repository('path/to/repository')
r.apply('foo') # segfault
Though I use 'foo' in this test, the same result arises if I pass in the string form of a Git diff.
I would expect pygit2 to coerce a string or Patch to a Diff, or at least to raise a Python exception instead of allowing the C backend to throw an error and crash the application.
The text was updated successfully, but these errors were encountered:
The segfault was already reported in issue #1033 and fixed with commit 23a4dd6, which has been released in v1.3.0
Traceback (most recent call last):
File "issue1037.py", line 3, in <module>
r.apply('foo') # segfault
TypeError: argument 1 must be _pygit2.Diff, not str
The apply method of a Repository fails ungracefully when I give it anything other than a Diff object. Specifically, when I pass in a Patch, the assertion
(repo && diff)
fails, even though the documentation says apply can accept a diff or a patch. When I pass in a string, the application simply segfaults.Repro:
Though I use 'foo' in this test, the same result arises if I pass in the string form of a Git diff.
I would expect pygit2 to coerce a string or Patch to a Diff, or at least to raise a Python exception instead of allowing the C backend to throw an error and crash the application.
The text was updated successfully, but these errors were encountered: