Skip to content

Commit 6f798f3

Browse files
committed
Correcting regex match
Stops paths such as test_git, testgit etc.. being matched
1 parent 12b952b commit 6f798f3

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

support/rewrite-hooks.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ do
1111
continue
1212
fi
1313

14-
if [[ "$dir" =~ ^.*.git$ ]]
14+
if [[ "$dir" =~ ^.*\.git$ ]]
1515
then
1616
project_hook="$src/$dir/hooks/post-receive"
1717
gitolite_hook="/home/git/gitlab-shell/hooks/post-receive"
@@ -23,7 +23,7 @@ do
2323
else
2424
for subdir in `ls "$src/$dir/"`
2525
do
26-
if [ -d "$src/$dir/$subdir" ] && [[ "$subdir" =~ ^.*.git$ ]]; then
26+
if [ -d "$src/$dir/$subdir" ] && [[ "$subdir" =~ ^.*\.git$ ]]; then
2727
project_hook="$src/$dir/$subdir/hooks/post-receive"
2828
gitolite_hook="/home/git/gitlab-shell/hooks/post-receive"
2929
ln -s -f $gitolite_hook $project_hook

0 commit comments

Comments
 (0)