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

gitlab.com/gitlab-org/gitaly.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKim "BKC" Carlbäcker <kim.carlbacker@gmail.com>2018-01-11 09:29:32 +0300
committerKim "BKC" Carlbäcker <kim.carlbacker@gmail.com>2018-01-11 09:30:49 +0300
commit093ceccfa8a07ee41a673690689eb1ac34200fdd (patch)
tree07f33b61e043d4904f5035ef0c215d33e257720b
parentf1f8949b6cc67cf5f0abe3da7d1750802f3681f7 (diff)
Update Gitlab::Git to b10ea6e386a025759aca5e9ef0d23931e77d1012
-rw-r--r--CHANGELOG.md2
-rw-r--r--ruby/vendor/gitlab_git/REVISION2
-rw-r--r--ruby/vendor/gitlab_git/lib/gitlab/git/gitlab_projects.rb30
-rw-r--r--ruby/vendor/gitlab_git/lib/gitlab/git/repository.rb17
4 files changed, 18 insertions, 33 deletions
diff --git a/CHANGELOG.md b/CHANGELOG.md
index 5352e3717..93e66c7cc 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -2,6 +2,8 @@
UNRELEASED
+- Update Gitlab::Git vendoring to b10ea6e386a025759aca5e9ef0d23931e77d1012
+ https://gitlab.com/gitlab-org/gitaly/merge_requests/525
- Use gitaly-proto 0.70.0
https://gitlab.com/gitlab-org/gitaly/merge_requests/522
diff --git a/ruby/vendor/gitlab_git/REVISION b/ruby/vendor/gitlab_git/REVISION
index 3a7af839d..95995173d 100644
--- a/ruby/vendor/gitlab_git/REVISION
+++ b/ruby/vendor/gitlab_git/REVISION
@@ -1 +1 @@
-33cea50976a6a066641b696527dc2d9e980183fb
+b10ea6e386a025759aca5e9ef0d23931e77d1012
diff --git a/ruby/vendor/gitlab_git/lib/gitlab/git/gitlab_projects.rb b/ruby/vendor/gitlab_git/lib/gitlab/git/gitlab_projects.rb
index cba638c06..976fa1ddf 100644
--- a/ruby/vendor/gitlab_git/lib/gitlab/git/gitlab_projects.rb
+++ b/ruby/vendor/gitlab_git/lib/gitlab/git/gitlab_projects.rb
@@ -41,36 +41,6 @@ module Gitlab
io.read
end
- def rm_project
- logger.info "Removing repository <#{repository_absolute_path}>."
- FileUtils.rm_rf(repository_absolute_path)
- end
-
- # Move repository from one directory to another
- #
- # Example: gitlab/gitlab-ci.git -> randx/six.git
- #
- # Won't work if target namespace directory does not exist
- #
- def mv_project(new_path)
- new_absolute_path = File.join(shard_path, new_path)
-
- # verify that the source repo exists
- unless File.exist?(repository_absolute_path)
- logger.error "mv-project failed: source path <#{repository_absolute_path}> does not exist."
- return false
- end
-
- # ...and that the target repo does not exist
- if File.exist?(new_absolute_path)
- logger.error "mv-project failed: destination path <#{new_absolute_path}> already exists."
- return false
- end
-
- logger.info "Moving repository from <#{repository_absolute_path}> to <#{new_absolute_path}>."
- FileUtils.mv(repository_absolute_path, new_absolute_path)
- end
-
# Import project via git clone --bare
# URL must be publicly cloneable
def import_project(source, timeout)
diff --git a/ruby/vendor/gitlab_git/lib/gitlab/git/repository.rb b/ruby/vendor/gitlab_git/lib/gitlab/git/repository.rb
index 283134e04..fa9bc57dd 100644
--- a/ruby/vendor/gitlab_git/lib/gitlab/git/repository.rb
+++ b/ruby/vendor/gitlab_git/lib/gitlab/git/repository.rb
@@ -1103,14 +1103,27 @@ module Gitlab
end
end
- def write_ref(ref_path, ref)
+ def write_ref(ref_path, ref, old_ref: nil, shell: true)
+ if shell
+ shell_write_ref(ref_path, ref, old_ref)
+ else
+ rugged_write_ref(ref_path, ref)
+ end
+ end
+
+ def shell_write_ref(ref_path, ref, old_ref)
raise ArgumentError, "invalid ref_path #{ref_path.inspect}" if ref_path.include?(' ')
raise ArgumentError, "invalid ref #{ref.inspect}" if ref.include?("\x00")
+ raise ArgumentError, "invalid old_ref #{old_ref.inspect}" if !old_ref.nil? && old_ref.include?("\x00")
- input = "update #{ref_path}\x00#{ref}\x00\x00"
+ input = "update #{ref_path}\x00#{ref}\x00#{old_ref}\x00"
run_git!(%w[update-ref --stdin -z]) { |stdin| stdin.write(input) }
end
+ def rugged_write_ref(ref_path, ref)
+ rugged.references.create(ref_path, ref, force: true)
+ end
+
def fetch_ref(source_repository, source_ref:, target_ref:)
Gitlab::Git.check_namespace!(source_repository)
source_repository = RemoteRepository.new(source_repository) unless source_repository.is_a?(RemoteRepository)