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

Fix nil reference in repo generation #9660

Merged
merged 2 commits into from
Jan 9, 2020

Conversation

jolheiser
Copy link
Member

Fix #9659

When no .gitea/template file is found, nil is returned. This is needed so we don't attempt expansions unless necessary, but it can lead to a nil reference in this case.

Signed-off-by: jolheiser <john.olheiser@gmail.com>
Signed-off-by: jolheiser <john.olheiser@gmail.com>
@codecov-io
Copy link

Codecov Report

Merging #9660 into master will increase coverage by <.01%.
The diff coverage is 0%.

Impacted file tree graph

@@            Coverage Diff            @@
##           master   #9660      +/-   ##
=========================================
+ Coverage    42.1%   42.1%   +<.01%     
=========================================
  Files         584     584              
  Lines       77485   77486       +1     
=========================================
+ Hits        32625   32627       +2     
+ Misses      40848   40846       -2     
- Partials     4012    4013       +1
Impacted Files Coverage Δ
models/repo_generate.go 3.8% <0%> (-0.02%) ⬇️
models/unit.go 67.56% <0%> (+5.4%) ⬆️

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 25531c7...dbe0bf1. Read the comment docs.

@GiteaBot GiteaBot added the lgtm/need 2 This PR needs two approvals by maintainers to be considered for merging. label Jan 9, 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 Jan 9, 2020
@techknowlogick techknowlogick added this to the 1.12.0 milestone Jan 9, 2020
@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 Jan 9, 2020
@lafriks lafriks merged commit ee9ce0c into go-gitea:master Jan 9, 2020
@lafriks
Copy link
Member

lafriks commented Jan 9, 2020

please send backport

@jolheiser jolheiser deleted the template_repo_fix branch January 9, 2020 14:20
jolheiser added a commit to jolheiser/gitea that referenced this pull request Jan 9, 2020
* Fix nil reference

Signed-off-by: jolheiser <john.olheiser@gmail.com>

* Tighten

Signed-off-by: jolheiser <john.olheiser@gmail.com>
zeripath pushed a commit that referenced this pull request Jan 9, 2020
* Fix nil reference

Signed-off-by: jolheiser <john.olheiser@gmail.com>

* Tighten

Signed-off-by: jolheiser <john.olheiser@gmail.com>
@zeripath zeripath added the backport/done All backports for this PR have been created label Jan 12, 2020
@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.

Can't create repository
7 participants