summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>2015-08-06 12:31:24 +0200
committerDmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>2015-08-06 12:31:24 +0200
commitd044c142907a274e5e91a93a8377c6879af80172 (patch)
treec27ad9a62c4cf9ca95700dde7c4fd1aa4bb29e91
parentce47dd4bb0c686aee13b309b07eb8f976aa5d547 (diff)
downloadgitlab-ce-fix-namespace-move-dir.tar.gz
Ensure old namespace directory exists before moving itfix-namespace-move-dir
Signed-off-by: Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>
-rw-r--r--app/models/namespace.rb3
1 files changed, 3 insertions, 0 deletions
diff --git a/app/models/namespace.rb b/app/models/namespace.rb
index 815672a1bf7..161a16ca61c 100644
--- a/app/models/namespace.rb
+++ b/app/models/namespace.rb
@@ -114,6 +114,9 @@ class Namespace < ActiveRecord::Base
end
def move_dir
+ # Ensure old directory exists before moving it
+ gitlab_shell.add_namespace(path_was)
+
if gitlab_shell.mv_namespace(path_was, path)
# If repositories moved successfully we need to
# send update instructions to users.