WIP: Add option to emulate force push via Commits API
What does this MR do?
Instead of deleting a branch, then recreating an updated version of the same branch, add an option to emulate a force push and overwrite the existing branch.
Manual testing
Using http (instead of curl, because I prefer http)
http POST http://localhost:3000/api/v4/projects/20/repository/commits Private-Token:XXXX < payload.json
{
"branch": "foo",
"start_branch": "master",
"commit_message": "testing",
"actions": [
{
"action": "create",
"content": "Greetings from an alternative universe!\n",
"file_path": "index.js"
}
],
"force": true
}
What are the relevant issue numbers?
Related changes:
- https://gitlab.com/jramsay/gitaly-proto/tree/jramsay/overwrite-branch (TODO merge request)
- https://gitlab.com/jramsay/gitaly/tree/jramsay/overwrite-branch (TODO merge request)
Closes #45035 (closed)
Does this MR meet the acceptance criteria?
-
Changelog entry added, if necessary -
Documentation created/updated -
Tests added for this feature/bug -
Conforms to the code review guidelines -
Conforms to the merge request performance guidelines -
Conforms to the style guides -
Conforms to the database guides -
Link to e2e tests MR added if this MR has Requires e2e tests label. See the Test Planning Process.