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