Commit 1001d93
fix: file save start_branch as a body attribute
Passing `start_branch` as kwargs results in it being passed as query
argument to the API:
```
send: b'PUT /api/v4/projects/12345678/repository/files/readme.txt?start_branch=main
send: b'{"file_path": "readme.txt", "branch": "new_branch", "content":
"Modified contents", "commit_message": "File was modified for this new
branch"}'
```
which results in error being returned:
```
{"message":"You can only create or edit files when you are on a branch"}
```
It should instead be sent a body attribute, which succeeds in creating
the branch during the save.
To be sent as body attribute it must be specified as concrete function
argument and class attribute instead of just using kwargs
Closes: #33181 parent 4a8d82b commit 1001d93
1 file changed
+8
-1
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
29 | 29 | | |
30 | 30 | | |
31 | 31 | | |
| 32 | + | |
32 | 33 | | |
33 | 34 | | |
34 | 35 | | |
| |||
41 | 42 | | |
42 | 43 | | |
43 | 44 | | |
44 | | - | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
45 | 50 | | |
46 | 51 | | |
47 | 52 | | |
| |||
50 | 55 | | |
51 | 56 | | |
52 | 57 | | |
| 58 | + | |
53 | 59 | | |
54 | 60 | | |
55 | 61 | | |
| |||
58 | 64 | | |
59 | 65 | | |
60 | 66 | | |
| 67 | + | |
61 | 68 | | |
62 | 69 | | |
63 | 70 | | |
| |||
0 commit comments