Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 8 additions & 2 deletions modules/context/repo.go
Original file line number Diff line number Diff line change
Expand Up @@ -414,8 +414,8 @@ func RepoAssignment() macaron.Handler {
}
}

// repo is empty and display enable
if ctx.Repo.Repository.IsEmpty || ctx.Repo.Repository.IsBeingCreated() {
// Disable everything when the repo is being created
if ctx.Repo.Repository.IsBeingCreated() {
ctx.Data["BranchName"] = ctx.Repo.Repository.DefaultBranch
return
}
Expand All @@ -427,6 +427,12 @@ func RepoAssignment() macaron.Handler {
}
ctx.Repo.GitRepo = gitRepo

// Stop at this point when the repo is empty.
if ctx.Repo.Repository.IsEmpty {
ctx.Data["BranchName"] = ctx.Repo.Repository.DefaultBranch
return
}

tags, err := ctx.Repo.GitRepo.GetTags()
if err != nil {
ctx.ServerError("GetTags", err)
Expand Down