gitlab_git 7.0.0.rc6 → 7.0.0.rc7

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (4) hide show
  1. checksums.yaml +4 -4
  2. data/VERSION +1 -1
  3. data/lib/gitlab_git/repository.rb +22 -19
  4. metadata +1 -1
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: fb7d2598502ec97b5d9a828685aa35f54b885ae5
4
- data.tar.gz: cbcc3b9da0a7d2cc30a7ab9c6c009e0df68fb6bd
3
+ metadata.gz: a017d97f4752bc24ff9fc7abe49b9fc0143301a9
4
+ data.tar.gz: c5bc10d54d6c635549c0d04a5cd71e29bf272247
5
5
  SHA512:
6
- metadata.gz: 761f437cb30cd9a4870ecf65c350da50d06b865252abc637730374246c7b21f5f0239737b463dd4d0461748092601b89a4952b4b4b36cf9055981d966433a935
7
- data.tar.gz: 12ec8756f8308c393b2395b9c8bc6c938cce6b0b51e9330e59964186f721c45f4eb9377af0d5a1524965b99e528601a80fa746b2025cfeb05e4113fd2b530dfe
6
+ metadata.gz: 84a528cad4b97c3e8ec7e177e59830b51eab8963d44eb491c09069cfa130cd62b3fb19df8ee1fb2cce5add69d452f891906bd1f8fe732ebc999de01d92276ba3
7
+ data.tar.gz: db2d09da3da1c07af108da6ee783f39b298408351e9161d697864b01d66a799443acd6b106489bf772e1b192036778c358d090bd892e611ada5146305b4fb908
data/VERSION CHANGED
@@ -1 +1 @@
1
- 7.0.0.rc6
1
+ 7.0.0.rc7
@@ -825,29 +825,32 @@ module Gitlab
825
825
  if extension == '.zip'
826
826
  create_zip_archive(ref_name, file_path, prefix)
827
827
  else
828
- rd_pipe, rw_pipe = IO.pipe
829
- tar_pid = fork do
830
- # Send the tar file to the write pipe
831
- rd_pipe.close
832
- Gem::Package::TarWriter.new(rw_pipe) do |tar|
833
- tar.mkdir(prefix, 33261)
834
-
835
- populated_index(ref_name).each do |entry|
836
- add_archive_entry(tar, prefix, entry)
837
- end
838
- end
839
- rw_pipe.close
840
- end
841
-
842
- # Use the other end of the pipe to compress with bzip2 or gzip
828
+ # Open the file with the final result
843
829
  FileUtils.mkdir_p(Pathname.new(file_path).dirname)
844
830
  archive_file = File.new(file_path, 'wb')
845
- rw_pipe.close
846
- system(*pipe_cmd, in: rd_pipe, out: archive_file)
847
831
 
848
- Process.waitpid(tar_pid)
849
- rd_pipe.close
832
+ # Create a pipe to communicate with the compressor process
833
+ pipe_rd, pipe_wr = IO.pipe
834
+ compress_pid = spawn(*pipe_cmd, in: pipe_rd, out: archive_file)
835
+ # pipe_rd and archive_file belong to the compressor process now; close
836
+ # them straightaway in our process.
837
+ pipe_rd.close
850
838
  archive_file.close
839
+
840
+ # Change the external encoding of pipe_wr to prevent Ruby from trying
841
+ # to convert binary to UTF-8.
842
+ pipe_wr = IO.new(pipe_wr.fileno, 'w:ASCII-8BIT')
843
+ Gem::Package::TarWriter.new(pipe_wr) do |tar|
844
+ tar.mkdir(prefix, 33261)
845
+
846
+ populated_index(ref_name).each do |entry|
847
+ add_archive_entry(tar, prefix, entry)
848
+ end
849
+ end
850
+ # We are done with pipe_wr, close it straightaway.
851
+ pipe_wr.close
852
+
853
+ Process.waitpid(compress_pid)
851
854
  end
852
855
  end
853
856
 
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: gitlab_git
3
3
  version: !ruby/object:Gem::Version
4
- version: 7.0.0.rc6
4
+ version: 7.0.0.rc7
5
5
  platform: ruby
6
6
  authors:
7
7
  - Dmitriy Zaporozhets