We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 8f0e63c commit 1b72690Copy full SHA for 1b72690
modules/context/repo.go
@@ -414,8 +414,8 @@ func RepoAssignment() macaron.Handler {
414
}
415
416
417
- // repo is empty and display enable
418
- if ctx.Repo.Repository.IsEmpty || ctx.Repo.Repository.IsBeingCreated() {
+ // Disable everything when the repo is being created
+ if ctx.Repo.Repository.IsBeingCreated() {
419
ctx.Data["BranchName"] = ctx.Repo.Repository.DefaultBranch
420
return
421
@@ -427,6 +427,12 @@ func RepoAssignment() macaron.Handler {
427
428
ctx.Repo.GitRepo = gitRepo
429
430
+ // Stop at this point when the repo is empty.
431
+ if ctx.Repo.Repository.IsEmpty {
432
+ ctx.Data["BranchName"] = ctx.Repo.Repository.DefaultBranch
433
+ return
434
+ }
435
+
436
tags, err := ctx.Repo.GitRepo.GetTags()
437
if err != nil {
438
ctx.ServerError("GetTags", err)
0 commit comments