Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSean McGivern <sean@mcgivern.me.uk>2017-10-16 13:36:06 +0300
committerSean McGivern <sean@mcgivern.me.uk>2017-10-16 13:36:06 +0300
commitb2553840e88bed82bad45712e2696de83fac1230 (patch)
tree0218a658d703f7fe09a67e5d82058c608cb55073 /lib/gitlab/git/repository.rb
parent3a7623fc010832c337e0ba0eb8650d7f6fca3562 (diff)
parent9fdde3693b3b49e929b7c80ccbec4abe412edb7f (diff)
Merge branch 'conflict-resolution-refactor' into 'master'
Conflict resolution refactor See merge request gitlab-org/gitlab-ce!14747
Diffstat (limited to 'lib/gitlab/git/repository.rb')
-rw-r--r--lib/gitlab/git/repository.rb18
1 files changed, 18 insertions, 0 deletions
diff --git a/lib/gitlab/git/repository.rb b/lib/gitlab/git/repository.rb
index 54f66b0683a..59a54b48ed9 100644
--- a/lib/gitlab/git/repository.rb
+++ b/lib/gitlab/git/repository.rb
@@ -1109,6 +1109,24 @@ module Gitlab
popen(args, @path).last.zero?
end
+ def blob_at(sha, path)
+ 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