Commit d6394a00f320cf2cba2b80f8c950e7686ab02bc5
Exists in
master
and in
4 other branches
Merge pull request #3002 from nafu/repo_patch
Fix file_name for archive
Showing
1 changed file
with
2 additions
and
2 deletions
Show diff stats
app/models/repository.rb
@@ -132,9 +132,9 @@ class Repository | @@ -132,9 +132,9 @@ class Repository | ||
132 | return nil unless commit | 132 | return nil unless commit |
133 | 133 | ||
134 | # Build file path | 134 | # Build file path |
135 | - file_name = self.path_with_namespace + "-" + commit.id.to_s + ".tar.gz" | 135 | + file_name = self.path_with_namespace.gsub("/","_") + "-" + commit.id.to_s + ".tar.gz" |
136 | storage_path = Rails.root.join("tmp", "repositories") | 136 | storage_path = Rails.root.join("tmp", "repositories") |
137 | - file_path = File.join(storage_path, file_name) | 137 | + file_path = File.join(storage_path, self.path_with_namespace, file_name) |
138 | 138 | ||
139 | # Put files into a directory before archiving | 139 | # Put files into a directory before archiving |
140 | prefix = self.path_with_namespace + "/" | 140 | prefix = self.path_with_namespace + "/" |