diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2022-10-04 00:09:57 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2022-10-04 00:09:57 +0300 |
commit | b8fcc8edb4a289ef3ef4fee0ed8fd88e853a2396 (patch) | |
tree | 31658d7760d36aa3b368e020e08f4d21c678f2e3 /spec/support/unpack-gitlab-git-test | |
parent | d83bbccfcd07ddab93be73959e3b149b75831e28 (diff) |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'spec/support/unpack-gitlab-git-test')
-rwxr-xr-x | spec/support/unpack-gitlab-git-test | 40 |
1 files changed, 0 insertions, 40 deletions
diff --git a/spec/support/unpack-gitlab-git-test b/spec/support/unpack-gitlab-git-test deleted file mode 100755 index 5d5f1b7d082..00000000000 --- a/spec/support/unpack-gitlab-git-test +++ /dev/null @@ -1,40 +0,0 @@ -#!/usr/bin/env ruby -# frozen_string_literal: true - -require 'fileutils' - -REPO = 'spec/support/gitlab-git-test.git' -PACK_DIR = REPO + '/objects/pack' -GIT = %W[git --git-dir=#{REPO}].freeze -BASE_PACK = 'pack-691247af2a6acb0b63b73ac0cb90540e93614043' - -def main - unpack - # We want to store the refs in a packed-refs file because if we don't - # they can get mangled by filesystems. - abort unless system(*GIT, *%w[pack-refs --all]) - abort unless system(*GIT, 'fsck') -end - -# We don't want contributors to commit new pack files because those -# create unnecessary churn. -def unpack - pack_files = Dir[File.join(PACK_DIR, '*')].reject do |pack| - pack.start_with?(File.join(PACK_DIR, BASE_PACK)) - end - return if pack_files.empty? - - pack_files.each do |pack| - unless pack.end_with?('.pack') - FileUtils.rm(pack) - next - end - - File.open(pack, 'rb') do |open_pack| - File.unlink(pack) - abort unless system(*GIT, 'unpack-objects', in: open_pack) - end - end -end - -main |