Skip to content
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

Implement rename branch API #32433

Open
wants to merge 6 commits into
base: main
Choose a base branch
from

Conversation

kemzeb
Copy link
Contributor

@kemzeb kemzeb commented Nov 6, 2024

Resolves #22526.

Builds upon #23061.

@GiteaBot GiteaBot added the lgtm/need 2 This PR needs two approvals by maintainers to be considered for merging. label Nov 6, 2024
@pull-request-size pull-request-size bot added the size/L Denotes a PR that changes 100-499 lines, ignoring generated files. label Nov 6, 2024
@github-actions github-actions bot added modifies/api This PR adds API routes or modifies them modifies/go Pull requests that update Go code labels Nov 6, 2024
routers/api/v1/repo/branch.go Outdated Show resolved Hide resolved
routers/api/v1/repo/branch.go Outdated Show resolved Hide resolved
@silverwind silverwind added the type/feature Completely new functionality. Can only be merged if feature freeze is not active. label Nov 6, 2024
routers/api/v1/api.go Outdated Show resolved Hide resolved
routers/api/v1/api.go Outdated Show resolved Hide resolved
}

branchName := opt.Name
if branchName != "" {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

How about return error if branchName is empty?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Since this is now a PATCH request I didn't know if it would be alright having the name field be required.

Then again it is the only field that I could think of that could be updated for a branch, so it maybe make more sense to make it required

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think so.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
lgtm/need 2 This PR needs two approvals by maintainers to be considered for merging. modifies/api This PR adds API routes or modifies them modifies/go Pull requests that update Go code size/L Denotes a PR that changes 100-499 lines, ignoring generated files. type/feature Completely new functionality. Can only be merged if feature freeze is not active.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Api for branch rename
5 participants