Title: fix: file save start_branch as a body attribute by nickbroon · Pull Request #3329 · python-gitlab/python-gitlab · GitHub
Open Graph Title: fix: file save start_branch as a body attribute by nickbroon · Pull Request #3329 · python-gitlab/python-gitlab
X Title: fix: file save start_branch as a body attribute by nickbroon · Pull Request #3329 · python-gitlab/python-gitlab
Description: 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: #3318 Changes Documentation and testing Please consider whether this PR needs documentation and tests. This is not required, but highly appreciated: Documentation in the matching docs section Unit tests and/or functional tests
Open Graph Description: 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'{"f...
X Description: 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'...
Opengraph URL: https://github.com/python-gitlab/python-gitlab/pull/3329
X: @github
Domain: patch-diff.githubusercontent.com
| route-pattern | /:user_id/:repository/pull/:id/files(.:format) |
| route-controller | pull_requests |
| route-action | files |
| fetch-nonce | v2:57bc1140-d1c4-ea95-c8d7-a8b5971e6642 |
| current-catalog-service-hash | ae870bc5e265a340912cde392f23dad3671a0a881730ffdadd82f2f57d81641b |
| request-id | A6D8:C53D0:2C38AD4:3E0497A:69710B12 |
| html-safe-nonce | 006c345db8be0df401034b7921c332d1ec132906b4a7d31550286aed9d90d9e5 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJBNkQ4OkM1M0QwOjJDMzhBRDQ6M0UwNDk3QTo2OTcxMEIxMiIsInZpc2l0b3JfaWQiOiIzNzMxMjE2MjYyOTY4Nzk4OTAiLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ== |
| visitor-hmac | 4e3dbc58ca4e0ad06f72ebbccfd1103a828272547cbc5d32f86ac278f7109a38 |
| hovercard-subject-tag | pull_request:3190791242 |
| github-keyboard-shortcuts | repository,pull-request-list,pull-request-conversation,pull-request-files-changed,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/python-gitlab/python-gitlab/pull/3329/files |
| twitter:image | https://avatars.githubusercontent.com/u/1462531?s=400&v=4 |
| twitter:card | summary_large_image |
| og:image | https://avatars.githubusercontent.com/u/1462531?s=400&v=4 |
| og:image:alt | 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'{"f... |
| og:site_name | GitHub |
| og:type | object |
| hostname | github.com |
| expected-hostname | github.com |
| None | 6d0e7b0d5e294a53c55f49e80755e785182080c6e6a48c9ed353bedddaee69f4 |
| turbo-cache-control | no-preview |
| diff-view | unified |
| go-import | github.com/python-gitlab/python-gitlab git https://github.com/python-gitlab/python-gitlab.git |
| octolytics-dimension-user_id | 28886265 |
| octolytics-dimension-user_login | python-gitlab |
| octolytics-dimension-repository_id | 8077625 |
| octolytics-dimension-repository_nwo | python-gitlab/python-gitlab |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 8077625 |
| octolytics-dimension-repository_network_root_nwo | python-gitlab/python-gitlab |
| turbo-body-classes | logged-out env-production page-responsive |
| disable-turbo | true |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | 6d5a3a396bc74e65fd3ef897b0a99a6e489debaa |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width