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-11-21 22:54:19 +0300
committerGrzegorz Bizon <grzegorz.bizon@ntsn.pl>2015-12-08 10:43:08 +0300
commit9f2752e5dcc31dc4e9d91ee18caf1d36f1b7684e (patch)
treee40c621edbf2a0ee6dc9bd0e8ec7ea97d823e903 /lib/gitlab/email/message
parent4beba7494b096f2540b19017bb7c1c8e91679135 (diff)
Remove obsolete variables in `repository_push_email`
Diffstat (limited to 'lib/gitlab/email/message')
-rw-r--r--lib/gitlab/email/message/repository_push.rb17
1 files changed, 14 insertions, 3 deletions
diff --git a/lib/gitlab/email/message/repository_push.rb b/lib/gitlab/email/message/repository_push.rb
index 61962abf822..b0af3feee9e 100644
--- a/lib/gitlab/email/message/repository_push.rb
+++ b/lib/gitlab/email/message/repository_push.rb
@@ -5,6 +5,9 @@ module Gitlab
attr_accessor :recipient
attr_reader :author_id, :ref, :action
+ delegate :namespace, :name_with_namespace, to: :project, prefix: :project
+ delegate :name, to: :author, prefix: :author
+
def initialize(notify, project_id, recipient, opts = {})
raise ArgumentError, 'Missing options: author_id, ref, action' unless
opts[:author_id] && opts[:ref] && opts[:action]
@@ -35,10 +38,18 @@ module Gitlab
@diffs ||= (compare.diffs if compare)
end
+ def diffs_count
+ diffs.count if diffs
+ end
+
def compare
@opts[:compare]
end
+ def compare_timeout
+ compare.timeout if compare
+ end
+
def reverse_compare?
@opts[:reverse_compare] || false
end
@@ -74,17 +85,17 @@ module Gitlab
def target_url
if @action == :push
if commits.length > 1 && compare
- @notify.namespace_project_compare_url(project.namespace,
+ @notify.namespace_project_compare_url(project_namespace,
project,
from: Commit.new(compare.base, project),
to: Commit.new(compare.head, project))
else
- @notify.namespace_project_commit_url(project.namespace,
+ @notify.namespace_project_commit_url(project_namespace,
project, commits.first)
end
else
unless @action == :delete
- @notify.namespace_project_tree_url(project.namespace,
+ @notify.namespace_project_tree_url(project_namespace,
project, ref_name)
end
end