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

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>2013-02-18 19:13:44 +0400
committerDmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>2013-02-18 19:13:44 +0400
commit26e340fc6c1b696d6621d3bb292aa2b050ebdee4 (patch)
tree40e823364645dfd9e9a9d787bef242fda1e74f0c
parente5080755a8ed79353096631ba3287d62c5e3e61f (diff)
parentdc1d4eab22658b276214912bdab4155111299355 (diff)
Merge pull request #3001 from nafu/4-2/repo_patch
Fix file_name for archive
-rw-r--r--app/models/repository.rb6
1 files changed, 3 insertions, 3 deletions
diff --git a/app/models/repository.rb b/app/models/repository.rb
index 6bfdf2255f2..f9db6342603 100644
--- a/app/models/repository.rb
+++ b/app/models/repository.rb
@@ -151,16 +151,16 @@ class Repository
return nil unless commit
# Build file path
- file_name = self.path_with_namespace + "-" + commit.id.to_s + ".tar.gz"
+ file_name = self.path_with_namespace.gsub("/","_") + "-" + commit.id.to_s + ".tar.gz"
storage_path = Rails.root.join("tmp", "repositories")
- file_path = File.join(storage_path, file_name)
+ file_path = File.join(storage_path, self.path_with_namespace, file_name)
# Put files into a directory before archiving
prefix = self.path_with_namespace + "/"
# Create file if not exists
unless File.exists?(file_path)
- FileUtils.mkdir_p storage_path
+ FileUtils.mkdir_p File.dirname(file_path)
file = self.repo.archive_to_file(ref, prefix, file_path)
end