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

Avoid MoreThanOne error when creating a branch whose name conflicts with other ref names #19591

Merged

Conversation

99rgosse
Copy link
Contributor

@99rgosse 99rgosse commented May 3, 2022

Hi ! this is the backport of #19557

This simple commit will ensure that we specify the "Branch" prefix when we want to create new branch. Fix #19346

Otherwise git would check between /refs/heads/tags and /refs/heads/branch and return
error: src refspec mytest matches more than one.
error: failed to push some refs to 'branch'
when there is a tag sharing the same name than the branch.

Tested also since we discussed in comments :
1 - making a branch named "thistag"
2 - creating a tag from it named "thistag"
3 - created a branch from the branch "thistag"
4 - created a PR from the new branch into branch "thistag", merged it, this works too !

Have a good day

@GiteaBot GiteaBot added the lgtm/need 2 This PR needs two approvals by maintainers to be considered for merging. label May 3, 2022
@99rgosse 99rgosse force-pushed the backport_Branch_Error_#19346 branch from e321de6 to 721a394 Compare May 3, 2022 08:50
@GiteaBot GiteaBot added lgtm/need 1 This PR needs approval from one additional maintainer to be merged. and removed lgtm/need 2 This PR needs two approvals by maintainers to be considered for merging. labels May 3, 2022
@6543 6543 added this to the 1.16.8 milestone May 3, 2022
@6543 6543 added the type/bug label May 3, 2022
@GiteaBot GiteaBot added lgtm/done This PR has enough approvals to get merged. There are no important open reservations anymore. and removed lgtm/need 1 This PR needs approval from one additional maintainer to be merged. labels May 3, 2022
@wxiaoguang wxiaoguang merged commit 6eb3c05 into go-gitea:release/v1.16 May 3, 2022
@wxiaoguang wxiaoguang changed the title Avoid MoreThanOne Error Avoid MoreThanOne error when creating a branch whose name conflicts with other ref names May 3, 2022
@go-gitea go-gitea locked and limited conversation to collaborators May 3, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
lgtm/done This PR has enough approvals to get merged. There are no important open reservations anymore. type/bug
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants