Skip to content

Commit 06ff9b6

Browse files
authored
Do not access GitRepo when a repo is being created (#33380)
1 parent 642e8c1 commit 06ff9b6

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

services/context/repo.go

+3
Original file line numberDiff line numberDiff line change
@@ -795,6 +795,9 @@ func RepoRefByType(detectRefType git.RefType) func(*Context) {
795795
return func(ctx *Context) {
796796
var err error
797797
refType := detectRefType
798+
if ctx.Repo.Repository.IsBeingCreated() {
799+
return // no git repo, so do nothing, users will see a "migrating" UI provided by "migrate/migrating.tmpl"
800+
}
798801
// Empty repository does not have reference information.
799802
if ctx.Repo.Repository.IsEmpty {
800803
// assume the user is viewing the (non-existent) default branch

0 commit comments

Comments
 (0)