1
1
mirror of https://github.com/go-gitea/gitea synced 2025-07-22 18:28:37 +00:00

More pleasantly handle broken or missing git repositories (#17747)

* More pleasantly handle broken or missing git repositories

In #17742 it was noted that there a completely invalid git repository underlying a
repo on gitea.com. This happened due to a problem during a migration however, it
is not beyond the realms of possibility that a corruption could occur to another
user.

This PR adds a check to RepoAssignment that will detect if a repository loading has
failed due to an absent git repository. It will then show a page suggesting the user
contacts the administrator or deletes the repository.

Fix #17742

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

* Update options/locale/locale_en-US.ini

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

Co-authored-by: techknowlogick <techknowlogick@gitea.io>
This commit is contained in:
zeripath
2021-11-22 22:32:16 +00:00
committed by GitHub
parent baed01f247
commit 1dbc58f742
6 changed files with 63 additions and 4 deletions

View File

@@ -10,7 +10,11 @@
{{.i18n.Tr "repo.archive.title"}}
</div>
{{end}}
{{if .CanWriteCode}}
{{if .Repository.IsBroken}}
<div class="ui segment center">
{{.i18n.Tr "repo.broken_message"}}
</div>
{{else if .CanWriteCode}}
<h4 class="ui top attached header">
{{.i18n.Tr "repo.quick_guide"}}
</h4>