Create repository branch API should be able to create a branch from a different repository (from a fork)
Description
In short:
I would like to mimic the Gitlab behavior when trying to edit a file in a repository where you do not have push access using the API.
Detailed:
When a user wants to edit a file in a repository where he/she does not have push access, Gitlab automatically creates a branch called patch-# in the user's fork. I would like to be able to do the same thing. Create a branch named patch-# in the fork but branching from the HEAD of the original repository branch using the API.
Proposal
The api could have one more parameter, the id of the source repository from which to branch.
Links / references
The Gitlab create repository branch API
GitHub implements this feature in their API by allowing the "ref" parameter to be a SHA of any commit from any repository not only from the one with the given id (https://developer.github.com/v3/git/refs/#create-a-reference).
This proposal is a possible duplicate of: 2956.
Overview
I would like to use this feature in a document editor application which allows users to edit files directly on Gitlab. When a user does not have push access I would like to allow him/her to create a fork and make a merge request with the push of a button directly from the app.
Use cases
Use in application which allows one to edit files directly from Gitlab without having to clone or know much about git.
Feature checklist
Make sure these are completed before closing the issue, with a link to the relevant commit.
-
Feature assurance -
Documentation -
Added to features.yml