Commit e104bdf1 authored by Angus MacArthur's avatar Angus MacArthur

fork fixes for upstream pull

Change-Id: Ia48a93ccbfea6fdc0791ce25cf3e6291bfe7fa08
parent a471d552
...@@ -33,6 +33,10 @@ Import repo ...@@ -33,6 +33,10 @@ Import repo
./bin/gitlab-projects import-project randx/six.git https://github.com/randx/six.git ./bin/gitlab-projects import-project randx/six.git https://github.com/randx/six.git
Fork repo
./bin/gitlab-projects fork-project gitlab/gitlab-ci.git randx
### Keys: ### Keys:
......
...@@ -13,6 +13,8 @@ require_relative '../lib/gitlab_init' ...@@ -13,6 +13,8 @@ require_relative '../lib/gitlab_init'
# #
# /bin/gitlab-projects mv-project gitlab/gitlab-ci.git randx/fork.git # /bin/gitlab-projects mv-project gitlab/gitlab-ci.git randx/fork.git
# #
# /bin/gitlab-projects fork-project gitlab/gitlab-ci.git randx
#
# /bin/gitlab-projects import-project randx/six.git https://github.com/randx/six.git # /bin/gitlab-projects import-project randx/six.git https://github.com/randx/six.git
# #
require File.join(ROOT_PATH, 'lib', 'gitlab_projects') require File.join(ROOT_PATH, 'lib', 'gitlab_projects')
......
...@@ -94,7 +94,7 @@ class GitlabProjects ...@@ -94,7 +94,7 @@ class GitlabProjects
namespaced_path = File.join(repos_path, new_namespace) namespaced_path = File.join(repos_path, new_namespace)
return false unless File.exists?(namespaced_path) return false unless File.exists?(namespaced_path)
cmd = "cd #{namespaced_path} && git clone --bare #{@full_path}" cmd = "cd #{namespaced_path} && git clone --bare #{full_path}"
system(cmd) system(cmd)
end end
end end
...@@ -78,13 +78,20 @@ describe GitlabProjects do ...@@ -78,13 +78,20 @@ describe GitlabProjects do
end end
describe :fork_project do describe :fork_project do
let(:gl_project_import) { build_gitlab_projects('import-project', repo_name, 'https://github.com/randx/six.git') }
let(:gl_projects) { build_gitlab_projects('fork-project', repo_name, 'forked-to-namespace')} let(:gl_projects) { build_gitlab_projects('fork-project', repo_name, 'forked-to-namespace')}
before do
FileUtils.mkdir_p(tmp_repo_path)
FileUtils.mkdir_p(File.join(tmp_repos_path, 'forked-to-namespace'))
gl_project_import.exec
end
it "should fork the repo" do it "should fork the repo" do
gl_projects.exec gl_projects.exec
File.exists?(File.join(tmp_repo_path, 'forked-to-namespace', repo_name)) File.exists?(File.join(tmp_repos_path, 'forked-to-namespace', repo_name)).should be_true
File.exists?(File.join(tmp_repo_path, 'forked-to-namespace', repo_name, '/hooks/update/post-receive')) File.exists?(File.join(tmp_repos_path, 'forked-to-namespace', repo_name, '/hooks/update/post-receive')).should be_true
File.exists?(File.join(tmp_repo_path, 'forked-to-namespace', repo_name, '/hooks/update/')) File.exists?(File.join(tmp_repos_path, 'forked-to-namespace', repo_name, '/hooks/update/')).should be_true
end end
end end
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment