diff options
author | Rémy Coutable <remy@rymai.me> | 2019-01-17 21:02:44 +0300 |
---|---|---|
committer | Rémy Coutable <remy@rymai.me> | 2019-01-17 21:02:44 +0300 |
commit | a71d8e19da723fe4fdd3c7d0ac7896c9d3130832 (patch) | |
tree | e7c89d89797cddc80ac80e1902360bbf0747bfd1 /lib | |
parent | daae58d280ab61fce24d5353dd7f2f95be7eb3cc (diff) | |
parent | c74820db07f1f7348cd6fbe2a2d5307ba0e9eeba (diff) |
Merge branch 'backup_restore_fix_issue_46891' into 'master'
Modify file restore to rectify tar issue
See merge request gitlab-org/gitlab-ce!24000
Diffstat (limited to 'lib')
-rw-r--r-- | lib/backup/files.rb | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/lib/backup/files.rb b/lib/backup/files.rb index 0032ae8f84b..2bac84846c5 100644 --- a/lib/backup/files.rb +++ b/lib/backup/files.rb @@ -71,8 +71,14 @@ module Backup end def run_pipeline!(cmd_list, options = {}) - status_list = Open3.pipeline(*cmd_list, options) - raise Backup::Error, 'Backup failed' unless status_list.compact.all?(&:success?) + err_r, err_w = IO.pipe + options[:err] = err_w + status = Open3.pipeline(*cmd_list, options) + err_w.close + return if status.compact.all?(&:success?) + + regex = /^g?tar: \.: Cannot mkdir: No such file or directory$/ + raise Backup::Error, 'Backup failed' unless err_r.read =~ regex end end end |