File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -65,13 +65,21 @@ def _repr(self):
6565 return '<Repository Commit [{0}]>' .format (self .sha [:7 ])
6666
6767 def diff (self ):
68- """Return the diff"""
68+ """Retrieve the diff for this commit.
69+
70+ :returns: the diff as a bytes object
71+ :rtype: bytes
72+ """
6973 resp = self ._get (self ._api ,
7074 headers = {'Accept' : 'application/vnd.github.diff' })
71- return resp .content if self ._boolean (resp , 200 , 404 ) else None
75+ return resp .content if self ._boolean (resp , 200 , 404 ) else b''
7276
7377 def patch (self ):
74- """Return the patch"""
78+ """Retrieve the patch formatted diff for this commit.
79+
80+ :returns: the patch as a bytes object
81+ :rtype: bytes
82+ """
7583 resp = self ._get (self ._api ,
7684 headers = {'Accept' : 'application/vnd.github.patch' })
77- return resp .content if self ._boolean (resp , 200 , 404 ) else None
85+ return resp .content if self ._boolean (resp , 200 , 404 ) else b''
You can’t perform that action at this time.
0 commit comments