Use a regular class for GitOperationService

Feedback:
https://gitlab.com/gitlab-org/gitlab-ce/merge_requests/7237#note_19747793
This commit is contained in:
Lin Jen-Shin 2016-12-14 02:03:04 +08:00
parent dc4b3dd0ae
commit 46d752ce21

View file

@ -1,5 +1,12 @@
GitOperationService = Struct.new(:user, :repository) do
class GitOperationService
attr_reader :user, :repository
def initialize(new_user, new_repository)
@user = new_user
@repository = new_repository
end
def add_branch(branch_name, newrev)
ref = Gitlab::Git::BRANCH_REF_PREFIX + branch_name
oldrev = Gitlab::Git::BLANK_SHA