From 7783f5ec73841fcd96dc3c86283b961e0459714a Mon Sep 17 00:00:00 2001
From: Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>
Date: Thu, 31 Jul 2014 21:30:35 +0300
Subject: [PATCH] Improve copy test repo cmd

Signed-off-by: Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>
---
 features/steps/explore/groups_feature.rb | 1 -
 spec/support/test_env.rb                 | 9 +++++----
 2 files changed, 5 insertions(+), 5 deletions(-)

diff --git a/features/steps/explore/groups_feature.rb b/features/steps/explore/groups_feature.rb
index 48486a83424..b529c5f8455 100644
--- a/features/steps/explore/groups_feature.rb
+++ b/features/steps/explore/groups_feature.rb
@@ -90,4 +90,3 @@ class Spinach::Features::ExploreGroupsFeature < Spinach::FeatureSteps
     )
   end
 end
-
diff --git a/spec/support/test_env.rb b/spec/support/test_env.rb
index 1f930eac026..e7bc209d948 100644
--- a/spec/support/test_env.rb
+++ b/spec/support/test_env.rb
@@ -49,15 +49,16 @@ module TestEnv
 
     unless File.directory?(repo_path)
       git_cmd = %W(git clone --bare #{clone_url} #{repo_path})
-      puts git_cmd.inspect
       system(*git_cmd)
     end
   end
 
   def copy_repo(project)
-    base_repo_path = repos_path + "/root/testme.git"
-    target_repo_path = repos_path + "/#{project.namespace.path}/#{project.path}.git"
-    FileUtils.cp_r(base_repo_path, target_repo_path)
+    base_repo_path = File.expand_path(repos_path + "/root/testme.git")
+    target_repo_path = File.expand_path(repos_path + "/#{project.namespace.path}/#{project.path}.git")
+    FileUtils.mkdir_p(target_repo_path)
+    FileUtils.cp_r("#{base_repo_path}/.", target_repo_path)
+    FileUtils.chmod_R 0755, target_repo_path
   end
 
   def repos_path
-- 
2.30.9