aboutsummaryrefslogtreecommitdiffstats
path: root/services
diff options
context:
space:
mode:
authorwxiaoguang <wxiaoguang@gmail.com>2025-01-05 23:18:02 +0800
committerGitHub <noreply@github.com>2025-01-05 23:18:02 +0800
commite637008fe3908a0027606846eab367e697ccc71d (patch)
tree96960297d9c6288ea43354de4655bde0f3fbb201 /services
parentfd281518aecb85be4984ad31a90698a2386d62a5 (diff)
downloadgitea-e637008fe3908a0027606846eab367e697ccc71d.tar.gz
gitea-e637008fe3908a0027606846eab367e697ccc71d.zip
Fix empty git repo handling logic and fix mobile view (#33101) (#33102)
Backport #33101 and UI fix from main (including #33108)
Diffstat (limited to 'services')
-rw-r--r--services/context/repo.go3
1 files changed, 0 insertions, 3 deletions
diff --git a/services/context/repo.go b/services/context/repo.go
index 9b54439110..1e7c430347 100644
--- a/services/context/repo.go
+++ b/services/context/repo.go
@@ -908,10 +908,8 @@ func RepoRefByType(detectRefType RepoRefType, opts ...RepoRefByTypeOptions) func
refName = brs[0].Name
} else if len(brs) == 0 {
log.Error("No branches in non-empty repository %s", ctx.Repo.GitRepo.Path)
- ctx.Repo.Repository.MarkAsBrokenEmpty()
} else {
log.Error("GetBranches error: %v", err)
- ctx.Repo.Repository.MarkAsBrokenEmpty()
}
}
ctx.Repo.RefName = refName
@@ -922,7 +920,6 @@ func RepoRefByType(detectRefType RepoRefType, opts ...RepoRefByTypeOptions) func
} else if strings.Contains(err.Error(), "fatal: not a git repository") || strings.Contains(err.Error(), "object does not exist") {
// if the repository is broken, we can continue to the handler code, to show "Settings -> Delete Repository" for end users
log.Error("GetBranchCommit: %v", err)
- ctx.Repo.Repository.MarkAsBrokenEmpty()
} else {
ctx.ServerError("GetBranchCommit", err)
return cancel