Skip to content

Commit 3ae71bb

Browse files
committed
fix
1 parent 10b6047 commit 3ae71bb

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

Diff for: routers/web/repo/view_home.go

+2-1
Original file line numberDiff line numberDiff line change
@@ -241,6 +241,7 @@ func handleRepoEmptyOrBroken(ctx *context.Context) {
241241
showEmpty := true
242242
if ctx.Repo.GitRepo != nil {
243243
reallyEmpty, err := ctx.Repo.GitRepo.IsEmpty()
244+
defaultBranchCommit, _ := ctx.Repo.GitRepo.GetBranchCommit(ctx.Repo.Repository.DefaultBranch)
244245
if err != nil {
245246
showEmpty = true // the repo is broken
246247
updateContextRepoEmptyAndStatus(ctx, true, repo_model.RepositoryBroken)
@@ -249,7 +250,7 @@ func handleRepoEmptyOrBroken(ctx *context.Context) {
249250
} else if reallyEmpty {
250251
showEmpty = true // the repo is really empty
251252
updateContextRepoEmptyAndStatus(ctx, true, repo_model.RepositoryReady)
252-
} else if ctx.Repo.Commit == nil {
253+
} else if defaultBranchCommit == nil {
253254
showEmpty = true // it is not really empty, but there is no branch
254255
// at the moment, other repo units like "actions" are not able to handle such case,
255256
// so we just mark the repo as empty to prevent from displaying these units.

Diff for: routers/web/web.go

+1-2
Original file line numberDiff line numberDiff line change
@@ -1335,8 +1335,7 @@ func registerRoutes(m *web.Router) {
13351335
m.Get(".atom", feedEnabled, repo.TagsListFeedAtom)
13361336
}, ctxDataSet("EnableFeed", setting.Other.EnableFeed),
13371337
repo.MustBeNotEmpty, context.RepoRefByType(context.RepoRefTag, context.RepoRefByTypeOptions{IgnoreNotExistErr: true}))
1338-
m.Post("/tags/delete", repo.DeleteTag, reqSignIn,
1339-
repo.MustBeNotEmpty, context.RepoMustNotBeArchived(), reqRepoCodeWriter, context.RepoRef())
1338+
m.Post("/tags/delete", reqSignIn, repo.MustBeNotEmpty, context.RepoMustNotBeArchived(), reqRepoCodeWriter, repo.DeleteTag)
13401339
}, optSignIn, context.RepoAssignment, reqRepoCodeReader)
13411340
// end "/{username}/{reponame}": repo tags
13421341

0 commit comments

Comments
 (0)