diff options
author | Alejandro RodrÃguez <alejorro70@gmail.com> | 2017-10-07 04:41:23 +0300 |
---|---|---|
committer | Alejandro RodrÃguez <alejorro70@gmail.com> | 2017-10-13 04:03:14 +0300 |
commit | 3fcab51ebb0f3156b5d732d050b292cd3e081262 (patch) | |
tree | 7292079f50121aae6e457bfd3dadb944fb2feeec /lib/gitlab/git/repository.rb | |
parent | 9cc15172deaa4582c5fd956cc163539041d018b1 (diff) |
Refactor conflict resolution to contain git ops within Gitlab::Git
This prepares the codebase for a Gitaly migration. See
https://gitlab.com/gitlab-org/gitaly/issues/553
Diffstat (limited to 'lib/gitlab/git/repository.rb')
-rw-r--r-- | lib/gitlab/git/repository.rb | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/lib/gitlab/git/repository.rb b/lib/gitlab/git/repository.rb index b705c92d686..0eae8913c49 100644 --- a/lib/gitlab/git/repository.rb +++ b/lib/gitlab/git/repository.rb @@ -1096,6 +1096,20 @@ module Gitlab Gitlab::Git::Blob.find(self, sha, path) unless Gitlab::Git.blank_ref?(sha) end + def commit_index(user, branch_name, index, options) + committer = user_to_committer(user) + + OperationService.new(user, self).with_branch(branch_name) do + commit_params = options.merge( + tree: index.write_tree(rugged), + author: committer, + committer: committer + ) + + create_commit(commit_params) + end + end + def gitaly_repository Gitlab::GitalyClient::Util.repository(@storage, @relative_path, @gl_repository) end |