-
-
Notifications
You must be signed in to change notification settings - Fork 5.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Extend fork API to support custom repo name and owner #6442
Comments
Good idea, really need it. |
... "allow an admin user to create forks for other users." -> you can use sudo header |
@yosiov , there is a workaround:
Interesting is that successive same requests result with
|
Doesn't look like a workaround to me. It does not fork for a user and set a new name at the same time. |
Hello, I'm new to the Gitea codebase but I'm willing to submit a patch for this issue. From what I understand, the necessary plumbing is already available in the web form implementation at routers/web/pull.go. For the API endpoint, we could respond with {
"message": "The repository with the same name already exists.",
"url": "https://git.batsense.net/api/swagger"
} So that the user can retry their request with an optional name parameter: curl -X 'POST' \
'https://git.example.com/api/v1/repos/owner/myrepo/forks' \
-H 'accept: application/json' \
-H 'authorization: Basic xxx' \
-H 'Content-Type: application/json' \
-d '{
"name": "forkOf-myrepo"
}' |
The current fork API (implemented in routers/api/v1/repo/fork.go) support forking a repo with two restrictions:
My suggestion is to support a custom repo name for the forked repo, and to allow an admin user to create forks for other users.
Do you think such an extension is reasonable? Should I send a PR for this?
The text was updated successfully, but these errors were encountered: