Ensure that GitRepo is set on Empty repositories #8539

Merged
lunny merged 3 commits from fix-8538-set-ctx.repo.GitRepo-on-empty into master 2019-10-16 13:08:02 +00:00
Contributor

Both issues/new and settings/hooks/git expect ctx.Repo.GitRepo to be set.
This PR changes the context code to open the GitRepo.

(We may want to check further what we need to disable/read in Empty repositories and whether we can allow more functionality by default on empty repositories.)

Fixes #8538

Both issues/new and settings/hooks/git expect `ctx.Repo.GitRepo` to be set. This PR changes the context code to open the GitRepo. (We may want to check further what we need to disable/read in Empty repositories and whether we can allow more functionality by default on empty repositories.) Fixes #8538
lunny approved these changes 2019-10-16 09:53:57 +00:00
lafriks (Migrated from github.com) approved these changes 2019-10-16 11:33:26 +00:00
codecov-io commented 2019-10-16 12:04:48 +00:00 (Migrated from github.com)
Owner

Codecov Report

Merging #8539 into master will increase coverage by <.01%.
The diff coverage is 83.33%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #8539      +/-   ##
==========================================
+ Coverage   41.63%   41.63%   +<.01%     
==========================================
  Files         523      523              
  Lines       67767    67772       +5     
==========================================
+ Hits        28216    28219       +3     
- Misses      35936    35941       +5     
+ Partials     3615     3612       -3
Impacted Files Coverage Δ
modules/context/repo.go 55.7% <83.33%> (-0.35%) ⬇️
modules/task/migrate.go 24.35% <0%> (-3.85%) ⬇️
models/error.go 32.08% <0%> (-1.25%) ⬇️
models/repo.go 47.91% <0%> (+0.05%) ⬆️
modules/migrations/gitea.go 11.75% <0%> (+1.49%) ⬆️
modules/migrations/migrate.go 22.9% <0%> (+1.67%) ⬆️

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 8f0e63c...b66d5e8. Read the comment docs.

# [Codecov](https://codecov.io/gh/go-gitea/gitea/pull/8539?src=pr&el=h1) Report > Merging [#8539](https://codecov.io/gh/go-gitea/gitea/pull/8539?src=pr&el=desc) into [master](https://codecov.io/gh/go-gitea/gitea/commit/8f0e63c80a2cd3b4362aa5e5191163e22fae6054?src=pr&el=desc) will **increase** coverage by `<.01%`. > The diff coverage is `83.33%`. [![Impacted file tree graph](https://codecov.io/gh/go-gitea/gitea/pull/8539/graphs/tree.svg?width=650&token=t1G57YGbPy&height=150&src=pr)](https://codecov.io/gh/go-gitea/gitea/pull/8539?src=pr&el=tree) ```diff @@ Coverage Diff @@ ## master #8539 +/- ## ========================================== + Coverage 41.63% 41.63% +<.01% ========================================== Files 523 523 Lines 67767 67772 +5 ========================================== + Hits 28216 28219 +3 - Misses 35936 35941 +5 + Partials 3615 3612 -3 ``` | [Impacted Files](https://codecov.io/gh/go-gitea/gitea/pull/8539?src=pr&el=tree) | Coverage Δ | | |---|---|---| | [modules/context/repo.go](https://codecov.io/gh/go-gitea/gitea/pull/8539/diff?src=pr&el=tree#diff-bW9kdWxlcy9jb250ZXh0L3JlcG8uZ28=) | `55.7% <83.33%> (-0.35%)` | :arrow_down: | | [modules/task/migrate.go](https://codecov.io/gh/go-gitea/gitea/pull/8539/diff?src=pr&el=tree#diff-bW9kdWxlcy90YXNrL21pZ3JhdGUuZ28=) | `24.35% <0%> (-3.85%)` | :arrow_down: | | [models/error.go](https://codecov.io/gh/go-gitea/gitea/pull/8539/diff?src=pr&el=tree#diff-bW9kZWxzL2Vycm9yLmdv) | `32.08% <0%> (-1.25%)` | :arrow_down: | | [models/repo.go](https://codecov.io/gh/go-gitea/gitea/pull/8539/diff?src=pr&el=tree#diff-bW9kZWxzL3JlcG8uZ28=) | `47.91% <0%> (+0.05%)` | :arrow_up: | | [modules/migrations/gitea.go](https://codecov.io/gh/go-gitea/gitea/pull/8539/diff?src=pr&el=tree#diff-bW9kdWxlcy9taWdyYXRpb25zL2dpdGVhLmdv) | `11.75% <0%> (+1.49%)` | :arrow_up: | | [modules/migrations/migrate.go](https://codecov.io/gh/go-gitea/gitea/pull/8539/diff?src=pr&el=tree#diff-bW9kdWxlcy9taWdyYXRpb25zL21pZ3JhdGUuZ28=) | `22.9% <0%> (+1.67%)` | :arrow_up: | ------ [Continue to review full report at Codecov](https://codecov.io/gh/go-gitea/gitea/pull/8539?src=pr&el=continue). > **Legend** - [Click here to learn more](https://docs.codecov.io/docs/codecov-delta) > `Δ = absolute <relative> (impact)`, `ø = not affected`, `? = missing data` > Powered by [Codecov](https://codecov.io/gh/go-gitea/gitea/pull/8539?src=pr&el=footer). Last update [8f0e63c...b66d5e8](https://codecov.io/gh/go-gitea/gitea/pull/8539?src=pr&el=lastupdated). Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments).
lafriks commented 2019-10-16 13:08:12 +00:00 (Migrated from github.com)
Owner

Please backport

Please backport
This repo is archived. You cannot comment on pull requests.
No reviewers
No Milestone
No project
No Assignees
2 Participants
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: lunny/gitea#8539
No description provided.