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:
authorNick Thomas <nick@gitlab.com>2018-01-23 22:03:02 +0300
committerNick Thomas <nick@gitlab.com>2018-02-05 13:38:57 +0300
commit30a43b7e04b98616f379bdd800532c3354df8b19 (patch)
tree62711e0084cf584b350469e41f5a02e5654de427 /app/models/concerns/storage
parentf5990e444a98dc259e2af8c373910cd9ec15b0bd (diff)
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.rb16
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