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
2537a0b2
Commit
2537a0b2
authored
Jul 19, 2013
by
Jacob Vosmaer
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Remove empty post-receive hook
parent
57f73737
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
7 additions
and
24 deletions
+7
-24
hooks/post-receive
hooks/post-receive
+0
-4
lib/gitlab_projects.rb
lib/gitlab_projects.rb
+1
-4
spec/gitlab_projects_spec.rb
spec/gitlab_projects_spec.rb
+0
-2
support/rewrite-hooks.sh
support/rewrite-hooks.sh
+6
-14
No files found.
hooks/post-receive
deleted
100755 → 0
View file @
57f73737
#!/usr/bin/env ruby
# This file was placed here by GitLab.
# You can put your own hook here, but be careful when updating gitlab-shell!
lib/gitlab_projects.rb
View file @
2537a0b2
...
@@ -182,9 +182,6 @@ class GitlabProjects
...
@@ -182,9 +182,6 @@ class GitlabProjects
private
private
def
create_hooks_to
(
dest_path
)
def
create_hooks_to
(
dest_path
)
pr_hook_path
=
File
.
join
(
ROOT_PATH
,
'hooks'
,
'post-receive'
)
"ln -s
#{
File
.
join
(
ROOT_PATH
,
'hooks'
,
'update'
)
}
#{
dest_path
}
/hooks/update"
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
end
end
spec/gitlab_projects_spec.rb
View file @
2537a0b2
...
@@ -101,7 +101,6 @@ describe GitlabProjects do
...
@@ -101,7 +101,6 @@ describe GitlabProjects do
it
"should receive valid cmd"
do
it
"should receive valid cmd"
do
valid_cmd
=
"cd
#{
tmp_repo_path
}
&& git init --bare"
valid_cmd
=
"cd
#{
tmp_repo_path
}
&& git init --bare"
valid_cmd
<<
" && ln -s
#{
ROOT_PATH
}
/hooks/post-receive
#{
tmp_repo_path
}
/hooks/post-receive"
valid_cmd
<<
" && ln -s
#{
ROOT_PATH
}
/hooks/update
#{
tmp_repo_path
}
/hooks/update"
valid_cmd
<<
" && ln -s
#{
ROOT_PATH
}
/hooks/update
#{
tmp_repo_path
}
/hooks/update"
gl_projects
.
should_receive
(
:system
).
with
(
valid_cmd
)
gl_projects
.
should_receive
(
:system
).
with
(
valid_cmd
)
gl_projects
.
exec
gl_projects
.
exec
...
@@ -238,7 +237,6 @@ describe GitlabProjects do
...
@@ -238,7 +237,6 @@ describe GitlabProjects do
gl_projects_fork
.
exec
.
should
be_true
gl_projects_fork
.
exec
.
should
be_true
File
.
exists?
(
dest_repo
).
should
be_true
File
.
exists?
(
dest_repo
).
should
be_true
File
.
exists?
(
File
.
join
(
dest_repo
,
'/hooks/update'
)).
should
be_true
File
.
exists?
(
File
.
join
(
dest_repo
,
'/hooks/update'
)).
should
be_true
File
.
exists?
(
File
.
join
(
dest_repo
,
'/hooks/post-receive'
)).
should
be_true
end
end
it
"should not fork if a project of the same name already exists"
do
it
"should not fork if a project of the same name already exists"
do
...
...
support/rewrite-hooks.sh
View file @
2537a0b2
...
@@ -6,29 +6,21 @@
...
@@ -6,29 +6,21 @@
home_dir
=
"/home/git"
home_dir
=
"/home/git"
src
=
${
1
:-
"
$home_dir
/repositories"
}
src
=
${
1
:-
"
$home_dir
/repositories"
}
function
create_link_in
{
ln
-s
-f
"
$home_dir
/gitlab-shell/hooks/update"
"
$1
/hooks/update"
}
for
dir
in
`
ls
"
$src
/"
`
for
dir
in
`
ls
"
$src
/"
`
do
do
if
[
-d
"
$src
/
$dir
"
]
;
then
if
[
-d
"
$src
/
$dir
"
]
;
then
if
[[
"
$dir
"
=
~ ^.
*
\.
git
$
]]
if
[[
"
$dir
"
=
~ ^.
*
\.
git
$
]]
then
then
project_hook
=
"
$src
/
$dir
/hooks/post-receive"
create_link_in
"
$src
/
$dir
"
gitlab_shell_hook
=
"
$home_dir
/gitlab-shell/hooks/post-receive"
ln
-s
-f
$gitlab_shell_hook
$project_hook
project_hook
=
"
$src
/
$dir
/hooks/update"
gitlab_shell_hook
=
"
$home_dir
/gitlab-shell/hooks/update"
ln
-s
-f
$gitlab_shell_hook
$project_hook
else
else
for
subdir
in
`
ls
"
$src
/
$dir
/"
`
for
subdir
in
`
ls
"
$src
/
$dir
/"
`
do
do
if
[
-d
"
$src
/
$dir
/
$subdir
"
]
&&
[[
"
$subdir
"
=
~ ^.
*
\.
git
$
]]
;
then
if
[
-d
"
$src
/
$dir
/
$subdir
"
]
&&
[[
"
$subdir
"
=
~ ^.
*
\.
git
$
]]
;
then
project_hook
=
"
$src
/
$dir
/
$subdir
/hooks/post-receive"
create_link_in
"
$src
/
$dir
/
$subdir
"
gitlab_shell_hook
=
"
$home_dir
/gitlab-shell/hooks/post-receive"
ln
-s
-f
$gitlab_shell_hook
$project_hook
project_hook
=
"
$src
/
$dir
/
$subdir
/hooks/update"
gitlab_shell_hook
=
"
$home_dir
/gitlab-shell/hooks/update"
ln
-s
-f
$gitlab_shell_hook
$project_hook
fi
fi
done
done
fi
fi
...
...
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