summaryrefslogtreecommitdiff
path: root/lib/gitlab/git
diff options
context:
space:
mode:
authorAhmad Sherif <me@ahmadsherif.com>2018-01-22 16:46:02 +0100
committerAhmad Sherif <me@ahmadsherif.com>2018-01-24 19:02:32 +0100
commit6a28967c1461a840926940beb075e4f9285c7e82 (patch)
treebc857c77ce914db1e6be131f7023e017249bff8a /lib/gitlab/git
parenta403011e4f7adae339a3a8584e22a75f4872c3c5 (diff)
downloadgitlab-ce-6a28967c1461a840926940beb075e4f9285c7e82.tar.gz
Migrate restoring repo from bundle to Gitalyfeature/migrate-repo-restorer-to-gitaly
Closes gitaly#946
Diffstat (limited to 'lib/gitlab/git')
-rw-r--r--lib/gitlab/git/repository.rb13
1 files changed, 13 insertions, 0 deletions
diff --git a/lib/gitlab/git/repository.rb b/lib/gitlab/git/repository.rb
index 9864e4251f1..cccfd284338 100644
--- a/lib/gitlab/git/repository.rb
+++ b/lib/gitlab/git/repository.rb
@@ -1187,6 +1187,19 @@ module Gitlab
end
end
+ def create_from_bundle(bundle_path)
+ gitaly_migrate(:create_repo_from_bundle) do |is_enabled|
+ if is_enabled
+ gitaly_repository_client.create_from_bundle(bundle_path)
+ else
+ run_git!(%W(clone --bare -- #{bundle_path} #{path}), chdir: nil)
+ self.class.create_hooks(path, File.expand_path(Gitlab.config.gitlab_shell.hooks_path))
+ end
+ end
+
+ true
+ end
+
def rebase(user, rebase_id, branch:, branch_sha:, remote_repository:, remote_branch:)
gitaly_migrate(:rebase) do |is_enabled|
if is_enabled