Commit 66f658a9 authored by Grzegorz Bizon's avatar Grzegorz Bizon

Check if commits are available in `RepositoryPush`

parent 59103596
...@@ -84,8 +84,8 @@ module Gitlab ...@@ -84,8 +84,8 @@ module Gitlab
end end
def target_url def target_url
if @action == :push if @action == :push && commits
if commits.length > 1 && compare if commits.length > 1
@urls.namespace_project_compare_url(project_namespace, @urls.namespace_project_compare_url(project_namespace,
project, project,
from: Commit.new(compare.base, project), from: Commit.new(compare.base, project),
...@@ -116,7 +116,7 @@ module Gitlab ...@@ -116,7 +116,7 @@ module Gitlab
subject_text << "[#{ref_name}]" if @action == :push subject_text << "[#{ref_name}]" if @action == :push
subject_text << ' ' subject_text << ' '
if @action == :push if @action == :push && commits
if commits.length > 1 if commits.length > 1
subject_text << "Deleted " if reverse_compare? subject_text << "Deleted " if reverse_compare?
subject_text << "#{commits.length} commits: #{commits.first.title}" subject_text << "#{commits.length} commits: #{commits.first.title}"
......
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