Skip to content

Push HEAD instead of master when initialising repositories#13719

Merged
techknowlogick merged 3 commits into
go-gitea:masterfrom
zeripath:handle-non-master-default-branch
Nov 28, 2020
Merged

Push HEAD instead of master when initialising repositories#13719
techknowlogick merged 3 commits into
go-gitea:masterfrom
zeripath:handle-non-master-default-branch

Conversation

@zeripath
Copy link
Copy Markdown
Contributor

It is possible on modern gits to change the initial branch to something other than
master. This breaks initialising repositories because we assume that the initial
branch is going to be master unless specifically changed.

This PR simply bypasses this issue by pushing the HEAD rather than the master branch.

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

It is possible on modern gits to change the initial branch to something other than
master. This breaks initialising repositories because we assume that the initial
branch is going to be master unless specifically changed.

This PR simply bypasses this issue by pushing the HEAD rather than the master branch.

Signed-off-by: Andrew Thornton <art27@cantab.net>
@zeripath zeripath added this to the 1.14.0 milestone Nov 27, 2020
Comment thread modules/repository/init.go Outdated
@GiteaBot GiteaBot added the lgtm/need 2 This PR needs two approvals by maintainers to be considered for merging. label Nov 27, 2020
@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 Nov 27, 2020
@codecov-io
Copy link
Copy Markdown

Codecov Report

Merging #13719 (5a79365) into master (7bc0c8c) will not change coverage.
The diff coverage is 100.00%.

Impacted file tree graph

@@           Coverage Diff           @@
##           master   #13719   +/-   ##
=======================================
  Coverage   42.25%   42.25%           
=======================================
  Files         697      697           
  Lines       76630    76630           
=======================================
  Hits        32380    32380           
- Misses      38925    38930    +5     
+ Partials     5325     5320    -5     
Impacted Files Coverage Δ
modules/repository/init.go 42.78% <100.00%> (ø)
models/repo_mirror.go 2.38% <0.00%> (-11.91%) ⬇️
modules/cron/tasks_basic.go 87.35% <0.00%> (-3.45%) ⬇️
models/unit.go 46.57% <0.00%> (-2.74%) ⬇️
modules/process/manager.go 72.50% <0.00%> (-2.50%) ⬇️
modules/queue/unique_queue_disk_channel.go 53.84% <0.00%> (-1.54%) ⬇️
modules/queue/workerpool.go 58.77% <0.00%> (-1.23%) ⬇️
services/mirror/mirror.go 15.98% <0.00%> (-1.17%) ⬇️
models/issue_comment.go 52.71% <0.00%> (+0.45%) ⬆️
models/error.go 36.75% <0.00%> (+0.49%) ⬆️
... 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 7bc0c8c...5a79365. Read the comment docs.

Co-authored-by: mrsdizzie <info@mrsdizzie.com>
@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 Nov 27, 2020
@techknowlogick
Copy link
Copy Markdown
Member

🚀

@techknowlogick techknowlogick merged commit 911d370 into go-gitea:master Nov 28, 2020
@zeripath zeripath deleted the handle-non-master-default-branch branch November 28, 2020 21:12
zeripath added a commit to zeripath/gitea that referenced this pull request Nov 28, 2020
…13719)

* Push HEAD instead of master when initialising repositories

It is possible on modern gits to change the initial branch to something other than
master. This breaks initialising repositories because we assume that the initial
branch is going to be master unless specifically changed.

This PR simply bypasses this issue by pushing the HEAD rather than the master branch.

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

* Update modules/repository/init.go

Co-authored-by: mrsdizzie <info@mrsdizzie.com>

Co-authored-by: mrsdizzie <info@mrsdizzie.com>
Co-authored-by: techknowlogick <techknowlogick@gitea.io>
@zeripath zeripath added the backport/done All backports for this PR have been created label Nov 28, 2020
techknowlogick added a commit that referenced this pull request Nov 28, 2020
…13740)

* Push HEAD instead of master when initialising repositories

It is possible on modern gits to change the initial branch to something other than
master. This breaks initialising repositories because we assume that the initial
branch is going to be master unless specifically changed.

This PR simply bypasses this issue by pushing the HEAD rather than the master branch.

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

* Update modules/repository/init.go

Co-authored-by: mrsdizzie <info@mrsdizzie.com>

Co-authored-by: mrsdizzie <info@mrsdizzie.com>
Co-authored-by: techknowlogick <techknowlogick@gitea.io>

Co-authored-by: mrsdizzie <info@mrsdizzie.com>
Co-authored-by: techknowlogick <techknowlogick@gitea.io>
@go-gitea go-gitea locked and limited conversation to collaborators Jan 18, 2021
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.

7 participants