File tree Expand file tree Collapse file tree 4 files changed +7
-24
lines changed Expand file tree Collapse file tree 4 files changed +7
-24
lines changed Load Diff This file was deleted.
Original file line number Diff line number Diff line change @@ -182,9 +182,6 @@ def update_head
182
182
private
183
183
184
184
def create_hooks_to ( dest_path )
185
- pr_hook_path = File . join ( ROOT_PATH , 'hooks' , 'post-receive' )
186
- up_hook_path = File . join ( ROOT_PATH , 'hooks' , 'update' )
187
-
188
- "ln -s #{ pr_hook_path } #{ dest_path } /hooks/post-receive && ln -s #{ up_hook_path } #{ dest_path } /hooks/update"
185
+ "ln -s #{ File . join ( ROOT_PATH , 'hooks' , 'update' ) } #{ dest_path } /hooks/update"
189
186
end
190
187
end
Original file line number Diff line number Diff line change 101
101
102
102
it "should receive valid cmd" do
103
103
valid_cmd = "cd #{ tmp_repo_path } && git init --bare"
104
- valid_cmd << " && ln -s #{ ROOT_PATH } /hooks/post-receive #{ tmp_repo_path } /hooks/post-receive"
105
104
valid_cmd << " && ln -s #{ ROOT_PATH } /hooks/update #{ tmp_repo_path } /hooks/update"
106
105
gl_projects . should_receive ( :system ) . with ( valid_cmd )
107
106
gl_projects . exec
238
237
gl_projects_fork . exec . should be_true
239
238
File . exists? ( dest_repo ) . should be_true
240
239
File . exists? ( File . join ( dest_repo , '/hooks/update' ) ) . should be_true
241
- File . exists? ( File . join ( dest_repo , '/hooks/post-receive' ) ) . should be_true
242
240
end
243
241
244
242
it "should not fork if a project of the same name already exists" do
Original file line number Diff line number Diff line change 6
6
home_dir=" /home/git"
7
7
src=${1:- " $home_dir /repositories" }
8
8
9
+ function create_link_in {
10
+ ln -s -f " $home_dir /gitlab-shell/hooks/update" " $1 /hooks/update"
11
+ }
12
+
9
13
for dir in ` ls " $src /" `
10
14
do
11
15
if [ -d " $src /$dir " ]; then
12
16
if [[ " $dir " =~ ^.* \. git$ ]]
13
17
then
14
- project_hook=" $src /$dir /hooks/post-receive"
15
- gitlab_shell_hook=" $home_dir /gitlab-shell/hooks/post-receive"
16
- ln -s -f $gitlab_shell_hook $project_hook
17
-
18
- project_hook=" $src /$dir /hooks/update"
19
- gitlab_shell_hook=" $home_dir /gitlab-shell/hooks/update"
20
- ln -s -f $gitlab_shell_hook $project_hook
18
+ create_link_in " $src /$dir "
21
19
else
22
20
for subdir in ` ls " $src /$dir /" `
23
21
do
24
22
if [ -d " $src /$dir /$subdir " ] && [[ " $subdir " =~ ^.* \. git$ ]]; then
25
- project_hook=" $src /$dir /$subdir /hooks/post-receive"
26
- gitlab_shell_hook=" $home_dir /gitlab-shell/hooks/post-receive"
27
- ln -s -f $gitlab_shell_hook $project_hook
28
-
29
- project_hook=" $src /$dir /$subdir /hooks/update"
30
- gitlab_shell_hook=" $home_dir /gitlab-shell/hooks/update"
31
- ln -s -f $gitlab_shell_hook $project_hook
23
+ create_link_in " $src /$dir /$subdir "
32
24
fi
33
25
done
34
26
fi
You can’t perform that action at this time.
0 commit comments