Skip to content

Commit 3a636c7

Browse files
committed
create_blob: allow creation of empty blobs
A blob with no content is still a valid blob, we should not refuse to create those. The GitHub API supports them, and so should we.
1 parent a8a2988 commit 3a636c7

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

github3/repos/repo.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -458,7 +458,7 @@ def create_blob(self, content, encoding):
458458
:returns: string of the SHA returned
459459
"""
460460
sha = ''
461-
if encoding in ('base64', 'utf-8') and content:
461+
if encoding in ('base64', 'utf-8'):
462462
url = self._build_url('git', 'blobs', base_url=self._api)
463463
data = {'content': content, 'encoding': encoding}
464464
json = self._json(self._post(url, data=data), 201)

0 commit comments

Comments
 (0)