Skip to content

Commit f6ebf80

Browse files
committed
Add more comments
1 parent 4624ce3 commit f6ebf80

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

routers/web/repo/view.go

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -850,6 +850,11 @@ func renderCode(ctx *context.Context) {
850850
return
851851
}
852852
// the repo is not really empty, so we should update the modal in database
853+
// such problem may be caused by:
854+
// 1) an error occurs during pushing/receiving. 2) the user replaces an empty git repo manually
855+
// and even more: the IsEmpty flag is deeply broken and should be removed with the UI changed to manage to cope with empty repos.
856+
// it's possible for a repository to be non-empty by that flag but still 500
857+
// because there are no branches - only tags -or the default branch is non-extant as it has been 0-pushed.
853858
ctx.Repo.Repository.IsEmpty = false
854859
if err = repo_model.UpdateRepositoryCols(ctx.Repo.Repository, "is_empty"); err != nil {
855860
ctx.ServerError("UpdateRepositoryCols", err)

0 commit comments

Comments
 (0)