gitlab-org--gitlab-foss/app/models/network/commit.rb
Douwe Maan 56de781a2c Revert "Enable Style/DotPosition"
This reverts commit e00fb2bdc2090e9cabeb1eb35a2672a882cc96e9.

# Conflicts:
#	.rubocop.yml
#	.rubocop_todo.yml
#	lib/gitlab/ci/config/entry/global.rb
#	lib/gitlab/ci/config/entry/jobs.rb
#	spec/lib/gitlab/ci/config/entry/factory_spec.rb
#	spec/lib/gitlab/ci/config/entry/global_spec.rb
#	spec/lib/gitlab/ci/config/entry/job_spec.rb
#	spec/lib/gitlab/ci/status/build/factory_spec.rb
#	spec/lib/gitlab/incoming_email_spec.rb
2017-02-23 09:33:19 -06:00

35 lines
601 B
Ruby

module Network
class Commit
include ActionView::Helpers::TagHelper
attr_accessor :time, :spaces, :parent_spaces
def initialize(raw_commit)
@commit = raw_commit
@time = -1
@spaces = []
@parent_spaces = []
end
def method_missing(m, *args, &block)
@commit.send(m, *args, &block)
end
def space
if @spaces.size > 0
@spaces.first
else
0
end
end
def parents(map)
@commit.parents.map do |p|
if map.include?(p.id)
map[p.id]
end
end
.compact
end
end
end