aboutsummaryrefslogtreecommitdiffstats
path: root/services
diff options
context:
space:
mode:
authorwxiaoguang <wxiaoguang@gmail.com>2025-01-25 02:27:36 +0800
committerGitHub <noreply@github.com>2025-01-24 18:27:36 +0000
commit06ff9b6256824a2dfee18adff5a8540412b22641 (patch)
tree098bb043c72fc0099ca038b4887b4d07102b97c5 /services
parent642e8c1122d40fd260f31cb9e2e2ee32c777aed5 (diff)
downloadgitea-06ff9b6256824a2dfee18adff5a8540412b22641.tar.gz
gitea-06ff9b6256824a2dfee18adff5a8540412b22641.zip
Do not access GitRepo when a repo is being created (#33380)
Diffstat (limited to 'services')
-rw-r--r--services/context/repo.go3
1 files changed, 3 insertions, 0 deletions
diff --git a/services/context/repo.go b/services/context/repo.go
index 6cd70d139b..32f8aaed2e 100644
--- a/services/context/repo.go
+++ b/services/context/repo.go
@@ -795,6 +795,9 @@ func RepoRefByType(detectRefType git.RefType) func(*Context) {
return func(ctx *Context) {
var err error
refType := detectRefType
+ if ctx.Repo.Repository.IsBeingCreated() {
+ return // no git repo, so do nothing, users will see a "migrating" UI provided by "migrate/migrating.tmpl"
+ }
// Empty repository does not have reference information.
if ctx.Repo.Repository.IsEmpty {
// assume the user is viewing the (non-existent) default branch