Commit dc1d4eab22658b276214912bdab4155111299355
1 parent
24a7c0f6
Fix repository.rb archive
Showing
1 changed file
with
2 additions
and
2 deletions
Show diff stats
app/models/repository.rb
| ... | ... | @@ -153,14 +153,14 @@ class Repository |
| 153 | 153 | # Build file path |
| 154 | 154 | file_name = self.path_with_namespace.gsub("/","_") + "-" + commit.id.to_s + ".tar.gz" |
| 155 | 155 | storage_path = Rails.root.join("tmp", "repositories") |
| 156 | - file_path = File.join(storage_path, file_name) | |
| 156 | + file_path = File.join(storage_path, self.path_with_namespace, file_name) | |
| 157 | 157 | |
| 158 | 158 | # Put files into a directory before archiving |
| 159 | 159 | prefix = self.path_with_namespace + "/" |
| 160 | 160 | |
| 161 | 161 | # Create file if not exists |
| 162 | 162 | unless File.exists?(file_path) |
| 163 | - FileUtils.mkdir_p storage_path | |
| 163 | + FileUtils.mkdir_p File.dirname(file_path) | |
| 164 | 164 | file = self.repo.archive_to_file(ref, prefix, file_path) |
| 165 | 165 | end |
| 166 | 166 | ... | ... |