File tree Expand file tree Collapse file tree 1 file changed +12
-4
lines changed Expand file tree Collapse file tree 1 file changed +12
-4
lines changed Original file line number Diff line number Diff line change @@ -64,13 +64,21 @@ def _repr(self):
64
64
return '<Comparison of {0} commits>' .format (self .total_commits )
65
65
66
66
def diff (self ):
67
- """Return the diff"""
67
+ """Retrieve the diff for this comparison.
68
+
69
+ :returns: the diff as a bytes object
70
+ :rtype: bytes
71
+ """
68
72
resp = self ._get (self ._api ,
69
73
headers = {'Accept' : 'application/vnd.github.diff' })
70
- return resp .content if self ._boolean (resp , 200 , 404 ) else None
74
+ return resp .content if self ._boolean (resp , 200 , 404 ) else b''
71
75
72
76
def patch (self ):
73
- """Return the patch"""
77
+ """Retrieve the patch formatted diff for this commit.
78
+
79
+ :returns: the patch as a bytes object
80
+ :rtype: bytes
81
+ """
74
82
resp = self ._get (self ._api ,
75
83
headers = {'Accept' : 'application/vnd.github.patch' })
76
- return resp .content if self ._boolean (resp , 200 , 404 ) else None
84
+ return resp .content if self ._boolean (resp , 200 , 404 ) else b''
You can’t perform that action at this time.
0 commit comments