diff options
author | Nick Thomas <nick@gitlab.com> | 2018-01-23 19:03:02 +0000 |
---|---|---|
committer | Nick Thomas <nick@gitlab.com> | 2018-02-05 10:38:57 +0000 |
commit | 30a43b7e04b98616f379bdd800532c3354df8b19 (patch) | |
tree | 62711e0084cf584b350469e41f5a02e5654de427 /app/models/concerns/storage | |
parent | f5990e444a98dc259e2af8c373910cd9ec15b0bd (diff) | |
download | gitlab-ce-30a43b7e04b98616f379bdd800532c3354df8b19.tar.gz |
Fix export removal for hashed-storage projects within a renamed or deleted namespace
Diffstat (limited to 'app/models/concerns/storage')
-rw-r--r-- | app/models/concerns/storage/legacy_namespace.rb | 16 |
1 files changed, 3 insertions, 13 deletions
diff --git a/app/models/concerns/storage/legacy_namespace.rb b/app/models/concerns/storage/legacy_namespace.rb index 99dbd4fbacf..b12c10a84de 100644 --- a/app/models/concerns/storage/legacy_namespace.rb +++ b/app/models/concerns/storage/legacy_namespace.rb @@ -87,20 +87,10 @@ module Storage remove_exports! end - def remove_exports! - Gitlab::Popen.popen(%W(find #{export_path} -not -path #{export_path} -delete)) - end - - def export_path - File.join(Gitlab::ImportExport.storage_path, full_path_was) - end + def remove_legacy_exports! + legacy_export_path = File.join(Gitlab::ImportExport.storage_path, full_path_was) - def full_path_was - if parent - parent.full_path + '/' + path_was - else - path_was - end + FileUtils.rm_rf(legacy_export_path) end end end |