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

Option to set default branch at repository creation #10803

Merged
merged 5 commits into from
Mar 26, 2020

Conversation

zeripath
Copy link
Contributor

@zeripath zeripath commented Mar 23, 2020

Fix #9542

Also fixes bug whereby template repos without a master branch cannot be templated and master branch rather than the default branch will be templated.

Signed-off-by: Andrew Thornton art27@cantab.net

Screenshots

Repository Creation Screen

Screenshot from 2020-03-23 10-08-48

Leaving the new option blank will default to master

Empty Repository Screen

Screenshot from 2020-03-23 10-10-07

Here the new empty repository has been created with the default branch called NotMaster. Note how the instructions have changed to suggest that the initial push is sent to NotMaster rather than master.

Default Commit

Screenshot from 2020-03-23 10-11-14

A new repository created with the default branch called rabbit

From a template

Screenshot from 2020-03-23 10-38-51

A new repository called testemplate was created similar to the above - it was then marked as a template and the repository testcreate was created from it.

Example of a bad default branch name

Screenshot from 2020-03-23 10-45-12

Fix go-gitea#9542

Signed-off-by: Andrew Thornton <art27@cantab.net>
@zeripath zeripath added the type/feature Completely new functionality. Can only be merged if feature freeze is not active. label Mar 23, 2020
@zeripath zeripath added this to the 1.12.0 milestone Mar 23, 2020
Signed-off-by: Andrew Thornton <art27@cantab.net>
@codecov-io
Copy link

Codecov Report

Merging #10803 into master will increase coverage by 0.00%.
The diff coverage is 73.68%.

Impacted file tree graph

@@           Coverage Diff           @@
##           master   #10803   +/-   ##
=======================================
  Coverage   43.53%   43.53%           
=======================================
  Files         589      589           
  Lines       82683    82698   +15     
=======================================
+ Hits        35993    36004   +11     
+ Misses      42221    42212    -9     
- Partials     4469     4482   +13     
Impacted Files Coverage Δ
models/repo.go 51.42% <ø> (ø)
modules/auth/repo_form.go 44.44% <ø> (ø)
modules/repository/generate.go 0.00% <0.00%> (ø)
modules/repository/init.go 57.14% <55.55%> (-0.29%) ⬇️
routers/repo/repo.go 31.60% <100.00%> (+0.16%) ⬆️
modules/ssh/ssh_graceful.go 30.76% <0.00%> (-9.24%) ⬇️
modules/queue/workerpool.go 54.80% <0.00%> (-3.21%) ⬇️
modules/git/command.go 86.95% <0.00%> (-2.61%) ⬇️
services/pull/patch.go 61.93% <0.00%> (-2.59%) ⬇️
services/pull/temp_repo.go 29.05% <0.00%> (-2.57%) ⬇️
... and 6 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update c61b902...c1568a1. Read the comment docs.

@GiteaBot GiteaBot added the lgtm/need 2 This PR needs two approvals by maintainers to be considered for merging. label Mar 23, 2020
@mrsdizzie
Copy link
Member

Could this be added to the api/v1/repo/repo.go repo create too?

@zeripath
Copy link
Contributor Author

@mrsdizzie Done - Sorry I missed it.

@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 Mar 25, 2020
Copy link
Member

@guillep2k guillep2k left a comment

Choose a reason for hiding this comment

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

Requires make generate-swagger. Otherwise looks good to me.

@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 Mar 26, 2020
@zeripath
Copy link
Contributor Author

d'oh

@zeripath zeripath merged commit 52cfd27 into go-gitea:master Mar 26, 2020
@zeripath zeripath deleted the fix-9542 branch March 26, 2020 19:14
zeripath pushed a commit that referenced this pull request Jul 5, 2020
…er default branch (#12135)

This fixes an issue I noticed with #10803: when you create a repo with a non-master default branch, gitea doesn't change the remote ref HEAD, so it still points at refs/heads/master. As a result, cloning my repos gives me error messages and doesn't check out the desired default branch, so I need to manually check it out after cloning.
techknowlogick pushed a commit to techknowlogick/gitea that referenced this pull request Jul 8, 2020
…er default branch (go-gitea#12135)

This fixes an issue I noticed with go-gitea#10803: when you create a repo with a non-master default branch, gitea doesn't change the remote ref HEAD, so it still points at refs/heads/master. As a result, cloning my repos gives me error messages and doesn't check out the desired default branch, so I need to manually check it out after cloning.
techknowlogick added a commit that referenced this pull request Jul 8, 2020
…er default branch (#12135) (#12182)

This fixes an issue I noticed with #10803: when you create a repo with a non-master default branch, gitea doesn't change the remote ref HEAD, so it still points at refs/heads/master. As a result, cloning my repos gives me error messages and doesn't check out the desired default branch, so I need to manually check it out after cloning.

Co-authored-by: xenofem <45297511+xenofem@users.noreply.github.com>
ydelafollye pushed a commit to ydelafollye/gitea that referenced this pull request Jul 31, 2020
…er default branch (go-gitea#12135)

This fixes an issue I noticed with go-gitea#10803: when you create a repo with a non-master default branch, gitea doesn't change the remote ref HEAD, so it still points at refs/heads/master. As a result, cloning my repos gives me error messages and doesn't check out the desired default branch, so I need to manually check it out after cloning.
abayer pushed a commit to abayer/gitea-go-sdk that referenced this pull request Sep 3, 2020
updates from go-gitea/gitea#10803

Co-authored-by: 6543 <6543@obermui.de>
Reviewed-on: https://gitea.com/gitea/go-sdk/pulls/300
Reviewed-by: Lunny Xiao <xiaolunwen@gmail.com>
Reviewed-by: mrsdizzie <info@mrsdizzie.com>
@go-gitea go-gitea locked and limited conversation to collaborators Nov 24, 2020
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/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.

Feature request - changing default branch name
6 participants