Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-shell
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Kirill Smelkov
gitlab-shell
Commits
e104bdf1
Commit
e104bdf1
authored
Apr 16, 2013
by
Angus MacArthur
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fork fixes for upstream pull
Change-Id: Ia48a93ccbfea6fdc0791ce25cf3e6291bfe7fa08
parent
a471d552
Changes
4
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
17 additions
and
4 deletions
+17
-4
README.md
README.md
+4
-0
bin/gitlab-projects
bin/gitlab-projects
+2
-0
lib/gitlab_projects.rb
lib/gitlab_projects.rb
+1
-1
spec/gitlab_projects_spec.rb
spec/gitlab_projects_spec.rb
+10
-3
No files found.
README.md
View file @
e104bdf1
...
...
@@ -33,6 +33,10 @@ Import repo
./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:
...
...
bin/gitlab-projects
View file @
e104bdf1
...
...
@@ -13,6 +13,8 @@ require_relative '../lib/gitlab_init'
#
# /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
#
require
File
.
join
(
ROOT_PATH
,
'lib'
,
'gitlab_projects'
)
...
...
lib/gitlab_projects.rb
View file @
e104bdf1
...
...
@@ -94,7 +94,7 @@ class GitlabProjects
namespaced_path
=
File
.
join
(
repos_path
,
new_namespace
)
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
)
end
end
spec/gitlab_projects_spec.rb
View file @
e104bdf1
...
...
@@ -78,13 +78,20 @@ describe GitlabProjects do
end
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'
)}
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
gl_projects
.
exec
File
.
exists?
(
File
.
join
(
tmp_repo
_path
,
'forked-to-namespace'
,
repo_name
))
File
.
exists?
(
File
.
join
(
tmp_repo
_path
,
'forked-to-namespace'
,
repo_name
,
'/hooks/update/post-receive'
))
File
.
exists?
(
File
.
join
(
tmp_repo
_path
,
'forked-to-namespace'
,
repo_name
,
'/hooks/update/'
))
File
.
exists?
(
File
.
join
(
tmp_repo
s_path
,
'forked-to-namespace'
,
repo_name
)).
should
be_true
File
.
exists?
(
File
.
join
(
tmp_repo
s_path
,
'forked-to-namespace'
,
repo_name
,
'/hooks/update/post-receive'
)).
should
be_true
File
.
exists?
(
File
.
join
(
tmp_repo
s_path
,
'forked-to-namespace'
,
repo_name
,
'/hooks/update/'
)).
should
be_true
end
end
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment