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, target_sha) ⇒ CommitPatches

Returns a new instance of CommitPatches.



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

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

Instance Method Details

#commitObject



17
18
19
20
21
22
23
24
25
26
27
# File 'lib/gitlab/git/patches/commit_patches.rb', line 17

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