File tree Expand file tree Collapse file tree 1 file changed +8
-2
lines changed Expand file tree Collapse file tree 1 file changed +8
-2
lines changed Original file line number Diff line number Diff line change @@ -414,8 +414,8 @@ func RepoAssignment() macaron.Handler {
414414 }
415415 }
416416
417- // repo is empty and display enable
418- if ctx .Repo .Repository .IsEmpty || ctx . Repo . Repository . IsBeingCreated () {
417+ // Disable everything when the repo is being created
418+ if ctx .Repo .Repository .IsBeingCreated () {
419419 ctx .Data ["BranchName" ] = ctx .Repo .Repository .DefaultBranch
420420 return
421421 }
@@ -427,6 +427,12 @@ func RepoAssignment() macaron.Handler {
427427 }
428428 ctx .Repo .GitRepo = gitRepo
429429
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+
430436 tags , err := ctx .Repo .GitRepo .GetTags ()
431437 if err != nil {
432438 ctx .ServerError ("GetTags" , err )
You can’t perform that action at this time.
0 commit comments