File tree Expand file tree Collapse file tree 1 file changed +12
-0
lines changed Expand file tree Collapse file tree 1 file changed +12
-0
lines changed Original file line number Diff line number Diff line change @@ -199,6 +199,10 @@ func CreateFile(ctx *context.APIContext, apiOpts api.CreateFileOptions) {
199
199
// "201":
200
200
// "$ref": "#/responses/FileResponse"
201
201
202
+ if apiOpts .BranchName == "" {
203
+ apiOpts .BranchName = ctx .Repo .Repository .DefaultBranch
204
+ }
205
+
202
206
opts := & repofiles.UpdateRepoFileOptions {
203
207
Content : apiOpts .Content ,
204
208
IsNewFile : true ,
@@ -271,6 +275,10 @@ func UpdateFile(ctx *context.APIContext, apiOpts api.UpdateFileOptions) {
271
275
// "200":
272
276
// "$ref": "#/responses/FileResponse"
273
277
278
+ if apiOpts .BranchName == "" {
279
+ apiOpts .BranchName = ctx .Repo .Repository .DefaultBranch
280
+ }
281
+
274
282
opts := & repofiles.UpdateRepoFileOptions {
275
283
Content : apiOpts .Content ,
276
284
SHA : apiOpts .SHA ,
@@ -377,6 +385,10 @@ func DeleteFile(ctx *context.APIContext, apiOpts api.DeleteFileOptions) {
377
385
return
378
386
}
379
387
388
+ if apiOpts .BranchName == "" {
389
+ apiOpts .BranchName = ctx .Repo .Repository .DefaultBranch
390
+ }
391
+
380
392
opts := & repofiles.DeleteRepoFileOptions {
381
393
Message : apiOpts .Message ,
382
394
OldBranch : apiOpts .BranchName ,
You can’t perform that action at this time.
0 commit comments