@@ -94,10 +94,12 @@ def __ne__(self, other):
94
94
return self .sha != other
95
95
96
96
@requires_auth
97
- def delete (self , message , committer = None , author = None ):
97
+ def delete (self , message , branch = None , committer = None , author = None ):
98
98
"""Delete this file.
99
99
100
100
:param str message: (required), commit message to describe the removal
101
+ :param str branch: (optional), branch where the file exists.
102
+ Defaults to the default branch of the repository.
101
103
:param dict committer: (optional), if no information is given the
102
104
authenticated user's information will be used. You must specify
103
105
both a name and email.
@@ -109,7 +111,7 @@ def delete(self, message, committer=None, author=None):
109
111
"""
110
112
json = None
111
113
if message :
112
- data = {'message' : message , 'sha' : self .sha ,
114
+ data = {'message' : message , 'sha' : self .sha , 'branch' : branch ,
113
115
'committer' : validate_commmitter (committer ),
114
116
'author' : validate_commmitter (author )}
115
117
self ._remove_none (data )
@@ -119,11 +121,14 @@ def delete(self, message, committer=None, author=None):
119
121
return json
120
122
121
123
@requires_auth
122
- def update (self , message , content , committer = None , author = None ):
124
+ def update (self , message , content , branch = None , committer = None ,
125
+ author = None ):
123
126
"""Update this file.
124
127
125
128
:param str message: (required), commit message to describe the update
126
129
:param str content: (required), content to update the file with
130
+ :param str branch: (optional), branch where the file exists.
131
+ Defaults to the default branch of the repository.
127
132
:param dict committer: (optional), if no information is given the
128
133
authenticated user's information will be used. You must specify
129
134
both a name and email.
@@ -140,7 +145,8 @@ def update(self, message, content, committer=None, author=None):
140
145
json = None
141
146
if message and content :
142
147
content = b64encode (content ).decode ('utf-8' )
143
- data = {'message' : message , 'content' : content , 'sha' : self .sha ,
148
+ data = {'message' : message , 'content' : content , 'branch' : branch ,
149
+ 'sha' : self .sha ,
144
150
'committer' : validate_commmitter (committer ),
145
151
'author' : validate_commmitter (author )}
146
152
self ._remove_none (data )
0 commit comments