gitlab_git 4.0.0.pre → 4.0.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/gitlab_git/blob.rb +9 -0
- data/lib/gitlab_git/repository.rb +25 -3
- metadata +4 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: b2108e7b969cd3dac473e6eb14311a72bf84972d
|
4
|
+
data.tar.gz: cafd1804445e5ee667fc98e9c6d9aa4d2c6d346b
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: d7005c9028474ca9bfc742980c1e66010add94963d1959bc37cedea82718ca448a7091d23155f69625199d0492ae630d006b7fc35a706448183081e0b34bc6ff
|
7
|
+
data.tar.gz: a6f8bdfe302fa68d094dc1bd3ed19aa217a028efb24cc0166e97bcf26c50cf8a0ca644c3c5a8bd84de9512c3154970f38b21293715a9dd7ae0d1f5d9b4d791c9
|
data/lib/gitlab_git/blob.rb
CHANGED
@@ -99,13 +99,35 @@ module Gitlab
|
|
99
99
|
# Already packed repo archives stored at
|
100
100
|
# app_root/tmp/repositories/project_name/project_name-commit-id.tag.gz
|
101
101
|
#
|
102
|
-
def archive_repo(ref, storage_path)
|
102
|
+
def archive_repo(ref, storage_path, format = "tar.gz")
|
103
103
|
ref = ref || self.root_ref
|
104
104
|
commit = Gitlab::Git::Commit.find(self, ref)
|
105
105
|
return nil unless commit
|
106
|
+
|
107
|
+
extension = nil
|
108
|
+
git_archive_format = nil
|
109
|
+
pipe_cmd = nil
|
110
|
+
|
111
|
+
case format
|
112
|
+
when "tar.bz2", "tbz", "tbz2", "tb2", "bz2"
|
113
|
+
extension = ".tar.bz2"
|
114
|
+
pipe_cmd = "bzip"
|
115
|
+
when "tar"
|
116
|
+
extension = ".tar"
|
117
|
+
pipe_cmd = "cat"
|
118
|
+
when "zip"
|
119
|
+
extension = ".zip"
|
120
|
+
git_archive_format = "zip"
|
121
|
+
pipe_cmd = "cat"
|
122
|
+
else
|
123
|
+
# everything else should fall back to tar.gz
|
124
|
+
extension = ".tar.gz"
|
125
|
+
git_archive_format = nil
|
126
|
+
pipe_cmd = "gzip"
|
127
|
+
end
|
106
128
|
|
107
129
|
# Build file path
|
108
|
-
file_name = self.name.gsub("\.git", "") + "-" + commit.id.to_s +
|
130
|
+
file_name = self.name.gsub("\.git", "") + "-" + commit.id.to_s + extension
|
109
131
|
file_path = File.join(storage_path, self.name, file_name)
|
110
132
|
|
111
133
|
# Put files into a directory before archiving
|
@@ -114,7 +136,7 @@ module Gitlab
|
|
114
136
|
# Create file if not exists
|
115
137
|
unless File.exists?(file_path)
|
116
138
|
FileUtils.mkdir_p File.dirname(file_path)
|
117
|
-
file = self.grit.archive_to_file(ref, prefix,
|
139
|
+
file = self.grit.archive_to_file(ref, prefix, file_path, git_archive_format, pipe_cmd)
|
118
140
|
end
|
119
141
|
|
120
142
|
file_path
|
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: 4.0.0
|
4
|
+
version: 4.0.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Dmitriy Zaporozhets
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2013-12-
|
11
|
+
date: 2013-12-26 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: gitlab-linguist
|
@@ -100,9 +100,9 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
100
100
|
version: '0'
|
101
101
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
102
102
|
requirements:
|
103
|
-
- - '
|
103
|
+
- - '>='
|
104
104
|
- !ruby/object:Gem::Version
|
105
|
-
version:
|
105
|
+
version: '0'
|
106
106
|
requirements: []
|
107
107
|
rubyforge_project:
|
108
108
|
rubygems_version: 2.1.11
|