|
|
|
@ -370,8 +370,10 @@ func editFilePost(ctx *context.Context, form forms.EditRepoFileForm, isNewFile b |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
if ctx.Repo.Repository.IsEmpty { |
|
|
|
|
if isEmpty, err := ctx.Repo.GitRepo.IsEmpty(); err == nil && !isEmpty { |
|
|
|
|
_ = repo_model.UpdateRepositoryCols(ctx, &repo_model.Repository{ID: ctx.Repo.Repository.ID, IsEmpty: false}, "is_empty") |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
redirectForCommitChoice(ctx, form.CommitChoice, branchName, form.TreePath) |
|
|
|
|
} |
|
|
|
@ -763,8 +765,10 @@ func UploadFilePost(ctx *context.Context) { |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
if ctx.Repo.Repository.IsEmpty { |
|
|
|
|
if isEmpty, err := ctx.Repo.GitRepo.IsEmpty(); err == nil && !isEmpty { |
|
|
|
|
_ = repo_model.UpdateRepositoryCols(ctx, &repo_model.Repository{ID: ctx.Repo.Repository.ID, IsEmpty: false}, "is_empty") |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
redirectForCommitChoice(ctx, form.CommitChoice, branchName, form.TreePath) |
|
|
|
|
} |
|
|
|
|