gitlab_git 7.2.18 → 7.2.19

Sign up to get free protection for your applications and to get access to all the features.
Files changed (4) hide show
  1. checksums.yaml +4 -4
  2. data/VERSION +1 -1
  3. data/lib/gitlab_git/repository.rb +12 -65
  4. metadata +2 -2
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 51faf2ed86cc7ec1871ab520a010387027e10934
4
- data.tar.gz: 2c0159a83e00d08ba95c79c05b3b270b2a715e8c
3
+ metadata.gz: 67ef4ed15aef21f374891ff34902b43458b1d571
4
+ data.tar.gz: c42c73310105cbf1678b015a6fb8ab2c7dd6aaef
5
5
  SHA512:
6
- metadata.gz: 8fc36043056991b48a5cca5d7a7b0521e5a0fcdb7b6c4a2396c5377e5bd6790916f910e6378d578efe905f23ee1678a722c29f94cec767865de21a84367bd381
7
- data.tar.gz: a21575ea3bff0c46aec1a5d6857fdc553b9fc45d12c47e37ded06d7046913b5fcc5538f664c89809ca96b374eedaa4ffc82d313fa2d5160f358d6357902c58c3
6
+ metadata.gz: a4c8012aea7f188bbc3d46692b5cd7e700a921309fc7b01897816ec199afa4c8bfdcea05b953de0a57b22da7c85428ef2f5f295d7a1b5930b2f9a8fd8d5fb772
7
+ data.tar.gz: f32eea0df1d2969f7f52c2641a35ac34615acd285e486576f730d034fcc19255cd122ad851ff2bcb17835dd25ec79ad261e08e911fa33110a0a8542ecc382d24
data/VERSION CHANGED
@@ -1 +1 @@
1
- 7.2.18
1
+ 7.2.19
@@ -138,73 +138,24 @@ module Gitlab
138
138
  nil
139
139
  end
140
140
 
141
- # Archive Project to .tar.gz
142
- #
143
- # Already packed repo archives stored at
144
- # app_root/tmp/repositories/<project_name>.git/<project_name>-<ref>-<commit id>.tar.gz
145
- #
146
- def archive_repo(ref, storage_path, format = "tar.gz")
147
- ref ||= root_ref
148
-
149
- file_path = archive_file_path(ref, storage_path, format)
150
- return nil unless file_path
151
-
152
- return file_path if File.exist?(file_path)
153
-
154
- case format
155
- when "tar.bz2", "tbz", "tbz2", "tb2", "bz2"
156
- compress_cmd = %W(bzip2)
157
- when "tar"
158
- compress_cmd = %W(cat)
159
- when "zip"
160
- git_archive_format = "zip"
161
- compress_cmd = %W(cat)
162
- else
163
- # everything else should fall back to tar.gz
164
- compress_cmd = %W(gzip -n)
165
- end
166
-
167
- FileUtils.mkdir_p File.dirname(file_path)
168
-
169
- pid_file_path = archive_pid_file_path(ref, storage_path, format)
170
- return file_path if File.exist?(pid_file_path)
171
-
172
- File.open(pid_file_path, "w") do |file|
173
- file.puts Process.pid
174
- end
175
-
176
- # Create the archive in temp file, to avoid leaving a corrupt archive
177
- # to be downloaded by the next user if we get interrupted while
178
- # creating the archive.
179
- temp_file_path = "#{file_path}.#{Process.pid}-#{Time.now.to_i}"
180
-
181
- begin
182
- archive_to_file(ref, temp_file_path, git_archive_format, compress_cmd)
183
- rescue
184
- FileUtils.rm(temp_file_path)
185
- raise
186
- ensure
187
- FileUtils.rm(pid_file_path)
188
- end
189
-
190
- # move temp file to persisted location
191
- FileUtils.move(temp_file_path, file_path)
192
-
193
- file_path
194
- end
195
-
196
- def archive_name(ref)
141
+ def archive_metadata(ref, storage_path, format = "tar.gz")
197
142
  ref ||= root_ref
198
143
  commit = Gitlab::Git::Commit.find(self, ref)
199
- return nil unless commit
144
+ return {} if commit.nil?
145
+
146
+ project_name = self.name.chomp('.git')
147
+ prefix = "#{project_name}-#{ref}-#{commit.id}"
200
148
 
201
- project_name = self.name.sub(/\.git\z/, "")
202
- file_name = "#{project_name}-#{ref}-#{commit.id}"
149
+ {
150
+ 'RepoPath' => path,
151
+ 'ArchivePrefix' => prefix,
152
+ 'ArchivePath' => archive_file_path(prefix, storage_path, format),
153
+ 'CommitId' => commit.id,
154
+ }
203
155
  end
204
156
 
205
- def archive_file_path(ref, storage_path, format = "tar.gz")
157
+ def archive_file_path(name, storage_path, format = "tar.gz")
206
158
  # Build file path
207
- name = archive_name(ref)
208
159
  return nil unless name
209
160
 
210
161
  extension =
@@ -224,10 +175,6 @@ module Gitlab
224
175
  File.join(storage_path, self.name, file_name)
225
176
  end
226
177
 
227
- def archive_pid_file_path(*args)
228
- "#{archive_file_path(*args)}.pid"
229
- end
230
-
231
178
  # Return repo size in megabytes
232
179
  def size
233
180
  size = popen(%W(du -s), path).first.strip.to_i
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: gitlab_git
3
3
  version: !ruby/object:Gem::Version
4
- version: 7.2.18
4
+ version: 7.2.19
5
5
  platform: ruby
6
6
  authors:
7
7
  - Dmitriy Zaporozhets
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-10-05 00:00:00.000000000 Z
11
+ date: 2015-10-15 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: gitlab-linguist