Skip to content

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:

Closes #45035 (closed)

Does this MR meet the acceptance criteria?

Edited by James Ramsay (ex-GitLab)

Merge request reports