Read about our upcoming Code of Conduct on this issue

This instance will be upgraded to Heptapod 0.28.0 on 2022-01-18 at 14:00 UTC+1 (a few minutes of down time)

Commit d0a95c30 authored by Dmitriy Zaporozhets's avatar Dmitriy Zaporozhets
Browse files

Ensure project discover default branch on Project#show

parent 3ff310865c41
......@@ -57,6 +57,10 @@ def show
limit = (params[:limit] || 20).to_i
@events =[:offset] || 0)
# Ensure project default branch is set if it possible
# Normally it defined on push or during creation
respond_to do |format|
format.html do
if @project.empty_repo?
......@@ -312,7 +312,7 @@ def execute_services(data)
def discover_default_branch
# Discover the default branch, but only if it hasn't already been set to
# something else
if repository && default_branch.nil?
if repository.exists? && default_branch.nil?
update_attributes(default_branch: self.repository.discover_default_branch)
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment