2018-11-09 13:39:43 -05:00
|
|
|
# frozen_string_literal: true
|
|
|
|
|
2017-09-01 06:11:59 -04:00
|
|
|
module Gitlab
|
|
|
|
module Git
|
|
|
|
class OperationService
|
2017-10-10 08:15:21 -04:00
|
|
|
BranchUpdate = Struct.new(:newrev, :repo_created, :branch_created) do
|
2017-09-08 08:00:53 -04:00
|
|
|
alias_method :repo_created?, :repo_created
|
|
|
|
alias_method :branch_created?, :branch_created
|
2017-10-10 08:15:21 -04:00
|
|
|
|
|
|
|
def self.from_gitaly(branch_update)
|
2018-07-19 13:48:58 -04:00
|
|
|
return if branch_update.nil?
|
|
|
|
|
2017-10-10 08:15:21 -04:00
|
|
|
new(
|
|
|
|
branch_update.commit_id,
|
|
|
|
branch_update.repo_created,
|
|
|
|
branch_update.branch_created
|
|
|
|
)
|
|
|
|
end
|
2017-09-08 08:00:53 -04:00
|
|
|
end
|
2017-09-01 06:11:59 -04:00
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|