summaryrefslogtreecommitdiff
path: root/app/helpers/ci/pipeline_editor_helper.rb
diff options
context:
space:
mode:
Diffstat (limited to 'app/helpers/ci/pipeline_editor_helper.rb')
-rw-r--r--app/helpers/ci/pipeline_editor_helper.rb4
1 files changed, 3 insertions, 1 deletions
diff --git a/app/helpers/ci/pipeline_editor_helper.rb b/app/helpers/ci/pipeline_editor_helper.rb
index bb7226da74e..3f0379b1baa 100644
--- a/app/helpers/ci/pipeline_editor_helper.rb
+++ b/app/helpers/ci/pipeline_editor_helper.rb
@@ -12,6 +12,8 @@ module Ci
initial_branch = params[:branch_name]
latest_commit = project.repository.commit(initial_branch) || project.commit
commit_sha = latest_commit ? latest_commit.sha : ''
+ total_branches = project.repository_exists? ? project.repository.branch_count : 0
+
{
"ci-config-path": project.ci_config_path_or_default,
"ci-examples-help-page-path" => help_page_path('ci/examples/index'),
@@ -29,7 +31,7 @@ module Ci
"project-full-path" => project.full_path,
"project-namespace" => project.namespace.full_path,
"runner-help-page-path" => help_page_path('ci/runners/index'),
- "total-branches" => project.repository.branches.length,
+ "total-branches" => total_branches,
"yml-help-page-path" => help_page_path('ci/yaml/index')
}
end