Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGrzegorz Bizon <grzegorz.bizon@ntsn.pl>2015-12-04 16:11:17 +0300
committerGrzegorz Bizon <grzegorz.bizon@ntsn.pl>2015-12-08 10:43:09 +0300
commit66f658a9b543b1493f625b2f44f3f845d64b749d (patch)
tree7cf86c3ae46fb977a12bc79179472c1bb26d7a6e /lib/gitlab/email/message
parent591035968dc96acd27155ced4c0ae04649fcd113 (diff)
Check if commits are available in `RepositoryPush`
Diffstat (limited to 'lib/gitlab/email/message')
-rw-r--r--lib/gitlab/email/message/repository_push.rb6
1 files changed, 3 insertions, 3 deletions
diff --git a/lib/gitlab/email/message/repository_push.rb b/lib/gitlab/email/message/repository_push.rb
index ca89b67e580..c53148d2ed8 100644
--- a/lib/gitlab/email/message/repository_push.rb
+++ b/lib/gitlab/email/message/repository_push.rb
@@ -84,8 +84,8 @@ module Gitlab
end
def target_url
- if @action == :push
- if commits.length > 1 && compare
+ if @action == :push && commits
+ if commits.length > 1
@urls.namespace_project_compare_url(project_namespace,
project,
from: Commit.new(compare.base, project),
@@ -116,7 +116,7 @@ module Gitlab
subject_text << "[#{ref_name}]" if @action == :push
subject_text << ' '
- if @action == :push
+ if @action == :push && commits
if commits.length > 1
subject_text << "Deleted " if reverse_compare?
subject_text << "#{commits.length} commits: #{commits.first.title}"