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
d3c3fbc6
Commit
d3c3fbc6
authored
Jul 19, 2013
by
Dmitriy Zaporozhets
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'remove_empty_post_receive' of /home/git/repositories/gitlab/gitlab-shell
parents
f13afa2d
2537a0b2
Changes
4
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
7 additions
and
30 deletions
+7
-30
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
-20
No files found.
hooks/post-receive
deleted
100755 → 0
View file @
f13afa2d
#!/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 @
d3c3fbc6
...
@@ -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 @
d3c3fbc6
...
@@ -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 @
d3c3fbc6
...
@@ -6,35 +6,21 @@
...
@@ -6,35 +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
"
=
"gitolite-admin.git"
]
then
continue
fi
if
[[
"
$dir
"
=
~ ^.
*
\.
git
$
]]
if
[[
"
$dir
"
=
~ ^.
*
\.
git
$
]]
then
then
project_hook
=
"
$src
/
$dir
/hooks/post-receive"
create_link_in
"
$src
/
$dir
"
gitolite_hook
=
"
$home_dir
/gitlab-shell/hooks/post-receive"
ln
-s
-f
$gitolite_hook
$project_hook
project_hook
=
"
$src
/
$dir
/hooks/update"
gitolite_hook
=
"
$home_dir
/gitlab-shell/hooks/update"
ln
-s
-f
$gitolite_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
"
gitolite_hook
=
"
$home_dir
/gitlab-shell/hooks/post-receive"
ln
-s
-f
$gitolite_hook
$project_hook
project_hook
=
"
$src
/
$dir
/
$subdir
/hooks/update"
gitolite_hook
=
"
$home_dir
/gitlab-shell/hooks/update"
ln
-s
-f
$gitolite_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