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:
Diffstat (limited to 'lib/gitlab/import_export/command_line_util.rb')
-rw-r--r--lib/gitlab/import_export/command_line_util.rb9
1 files changed, 9 insertions, 0 deletions
diff --git a/lib/gitlab/import_export/command_line_util.rb b/lib/gitlab/import_export/command_line_util.rb
index ace9d83dc9a..6c0b6de9e85 100644
--- a/lib/gitlab/import_export/command_line_util.rb
+++ b/lib/gitlab/import_export/command_line_util.rb
@@ -15,8 +15,17 @@ module Gitlab
end
def gzip(dir:, filename:)
+ gzip_with_options(dir: dir, filename: filename)
+ end
+
+ def gunzip(dir:, filename:)
+ gzip_with_options(dir: dir, filename: filename, options: 'd')
+ end
+
+ def gzip_with_options(dir:, filename:, options: nil)
filepath = File.join(dir, filename)
cmd = %W(gzip #{filepath})
+ cmd << "-#{options}" if options
_, status = Gitlab::Popen.popen(cmd)