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

Set default branchname on first push #3715

Merged
merged 2 commits into from
Mar 25, 2018
Merged

Conversation

Bwko
Copy link
Member

@Bwko Bwko commented Mar 24, 2018

Fixes #3204 & fixes #3525

@codecov-io
Copy link

codecov-io commented Mar 25, 2018

Codecov Report

Merging #3715 into master will decrease coverage by <.01%.
The diff coverage is 25%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #3715      +/-   ##
==========================================
- Coverage   35.79%   35.78%   -0.01%     
==========================================
  Files         288      288              
  Lines       41578    41581       +3     
==========================================
  Hits        14881    14881              
- Misses      24500    24503       +3     
  Partials     2197     2197
Impacted Files Coverage Δ
models/action.go 63.91% <25%> (-0.42%) ⬇️
models/repo_indexer.go 48.3% <0%> (ø) ⬆️

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 cb87f29...5007c14. Read the comment docs.

@tboerger tboerger added the lgtm/need 2 This PR needs two approvals by maintainers to be considered for merging. label Mar 25, 2018
@lunny lunny added the type/bug label Mar 25, 2018
@lunny lunny added this to the 1.5.0 milestone Mar 25, 2018
models/action.go Outdated
refName := git.RefEndName(opts.RefFullName)
if repo.IsBare && refName != repo.DefaultBranch {
repo.DefaultBranch = refName
if err = repo.UpdateDefaultBranch(); err != nil {
Copy link
Member

Choose a reason for hiding this comment

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

why not update on line 536?

@Bwko Bwko force-pushed the fix_default_branch branch from 09d6002 to 52e78f9 Compare March 25, 2018 05:35
@tboerger tboerger 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, 2018
@lafriks
Copy link
Member

lafriks commented Mar 25, 2018

@lunny need your approval

@tboerger tboerger 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 25, 2018
@lunny lunny merged commit 321cc2a into go-gitea:master Mar 25, 2018
@Bwko Bwko deleted the fix_default_branch branch March 25, 2018 13:23
@lafriks
Copy link
Member

lafriks commented Mar 25, 2018

@Bwko please backport to release/v1.4 branch

@lafriks
Copy link
Member

lafriks commented Apr 11, 2018

@Bwko small reminder ;)

@lafriks lafriks added the backport/done All backports for this PR have been created label May 2, 2018
@davidlt
Copy link

davidlt commented May 7, 2018

This is a bit annoying for people doing git clone --mirror / git push --mirror and expecting master to be the default. This broke my workflow because now the first pushed branch becomes defaults, which is a bit random if you do git push --mirror and you have to go in the settings after each git push --mirror to set it to master.

@lafriks
Copy link
Member

lafriks commented May 7, 2018

@davidlt please open issue

@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
backport/done All backports for this PR have been created 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.

Wrong label on branch dropdown Default branch is not master will display master
8 participants