@@ -14,7 +14,6 @@ import (
1414 repo_model "code.gitea.io/gitea/models/repo"
1515 "code.gitea.io/gitea/models/unit"
1616 "code.gitea.io/gitea/modules/git"
17- "code.gitea.io/gitea/modules/gitrepo"
1817 "code.gitea.io/gitea/modules/log"
1918 repo_module "code.gitea.io/gitea/modules/repository"
2019 "code.gitea.io/gitea/modules/templates"
@@ -160,22 +159,12 @@ func pushToEditRepositoryOrError(ctx *context.Context, editRepo *repo_model.Repo
160159 return branchName , nil
161160}
162161
163- // updateEditRepositoryIsEmpty updates the the edit repository to mark it as no longer empty
164- func updateEditRepositoryIsEmpty (ctx * context.Context , editRepo * repo_model.Repository ) {
162+ // markRepositoryAsNonEmpty marks the repository as no longer empty
163+ func markRepositoryAsNonEmpty (ctx * context.Context , editRepo * repo_model.Repository ) {
165164 if ! editRepo .IsEmpty {
166165 return
167166 }
168-
169- editGitRepo , err := gitrepo .OpenRepository (ctx , editRepo )
170- if err != nil {
171- log .Error ("gitrepo.OpenRepository: %v" , err )
172- return
173- }
174- defer editGitRepo .Close ()
175-
176- if isEmpty , err := editGitRepo .IsEmpty (); err == nil && ! isEmpty {
177- _ = repo_model .UpdateRepositoryCols (ctx , & repo_model.Repository {ID : editRepo .ID , IsEmpty : false }, "is_empty" )
178- }
167+ _ = repo_model .UpdateRepositoryCols (ctx , & repo_model.Repository {ID : editRepo .ID , IsEmpty : false }, "is_empty" )
179168}
180169
181170func forkToEditFileCommon (ctx * context.Context , editOperation , treePath string , notEditableMessage any ) {
0 commit comments