Class: Gitlab::Git::Patches::CommitPatches

Inherits:
Object
  • Object
show all
Includes:
WrapsGitalyErrors
Defined in:
lib/gitlab/git/patches/commit_patches.rb

Instance Method Summary collapse

Methods included from WrapsGitalyErrors

#wrapped_gitaly_errors

Constructor Details

#initialize(user, repository, branch, patch_collection) ⇒ CommitPatches

Returns a new instance of CommitPatches.



9
10
11
12
13
14
# File 'lib/gitlab/git/patches/commit_patches.rb', line 9

def initialize(user, repository, branch, patch_collection)
  @user = user
  @repository = repository
  @branch = branch
  @patches = patch_collection
end

Instance Method Details

#commitObject



16
17
18
19
20
21
22
# File 'lib/gitlab/git/patches/commit_patches.rb', line 16

def commit
  repository.with_cache_hooks do
    wrapped_gitaly_errors do
      operation_service.user_commit_patches(user, branch, patches.content)
    end
  end
end