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
# File 'lib/gitlab/git/patches/commit_patches.rb', line 9

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

Instance Method Details

#commitObject


13
14
15
16
17
18
19
# File 'lib/gitlab/git/patches/commit_patches.rb', line 13

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