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
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
nexedi
gitlab-shell
Commits
934aacb3
Commit
934aacb3
authored
Apr 16, 2013
by
Angus MacArthur
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
more fixes for pull reuest
Change-Id: I1b3d64d79187c414e326928a96427d1cc6176224
parent
e104bdf1
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
16 additions
and
7 deletions
+16
-7
lib/gitlab_projects.rb
lib/gitlab_projects.rb
+14
-5
spec/gitlab_projects_spec.rb
spec/gitlab_projects_spec.rb
+2
-2
No files found.
lib/gitlab_projects.rb
View file @
934aacb3
...
...
@@ -45,10 +45,7 @@ class GitlabProjects
end
def
create_hooks_cmd
pr_hook_path
=
File
.
join
(
ROOT_PATH
,
'hooks'
,
'post-receive'
)
up_hook_path
=
File
.
join
(
ROOT_PATH
,
'hooks'
,
'update'
)
"ln -s
#{
pr_hook_path
}
#{
full_path
}
/hooks/post-receive && ln -s
#{
up_hook_path
}
#{
full_path
}
/hooks/update"
create_hooks_to
(
full_path
)
end
def
rm_project
...
...
@@ -93,8 +90,20 @@ class GitlabProjects
namespaced_path
=
File
.
join
(
repos_path
,
new_namespace
)
return
false
unless
File
.
exists?
(
namespaced_path
)
full_destination_path
=
File
.
join
(
namespaced_path
,
project_name
)
cmd
=
"cd
#{
namespaced_path
}
&& git clone --bare
#{
full_path
}
"
cmd
=
"cd
#{
namespaced_path
}
&& git clone --bare
#{
full_path
}
&&
#{
create_hooks_to
(
full_destination_path
)
}
"
system
(
cmd
)
end
private
def
create_hooks_to
(
dest_path
)
pr_hook_path
=
File
.
join
(
ROOT_PATH
,
'hooks'
,
'post-receive'
)
up_hook_path
=
File
.
join
(
ROOT_PATH
,
'hooks'
,
'update'
)
"ln -s
#{
pr_hook_path
}
#{
dest_path
}
/hooks/post-receive && ln -s
#{
up_hook_path
}
#{
dest_path
}
/hooks/update"
end
end
spec/gitlab_projects_spec.rb
View file @
934aacb3
...
...
@@ -90,8 +90,8 @@ describe GitlabProjects do
it
"should fork the repo"
do
gl_projects
.
exec
File
.
exists?
(
File
.
join
(
tmp_repos_path
,
'forked-to-namespace'
,
repo_name
)).
should
be_true
File
.
exists?
(
File
.
join
(
tmp_repos_path
,
'forked-to-namespace'
,
repo_name
,
'/hooks/update
/post-receive
'
)).
should
be_true
File
.
exists?
(
File
.
join
(
tmp_repos_path
,
'forked-to-namespace'
,
repo_name
,
'/hooks/
update/
'
)).
should
be_true
File
.
exists?
(
File
.
join
(
tmp_repos_path
,
'forked-to-namespace'
,
repo_name
,
'/hooks/update'
)).
should
be_true
File
.
exists?
(
File
.
join
(
tmp_repos_path
,
'forked-to-namespace'
,
repo_name
,
'/hooks/
post-receive
'
)).
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