post-receive-hook: Remove trailing .git from project name
[girocco/msimkins.git] / post-receive-hook
blob22679f2481080042c3124f5662070e8892798a1c
1 #!/bin/sh
3 # Send notification through the taskd socket
5 # Beware, we MAY be running in a chroot!
7 set -e
9 sockpath=/etc/taskd.socket
10 cwd="$(pwd)"
11 if [ -x /usr/bin/perl ]; then
12 # Not in chroot...
13 . @basedir@/shlib.sh
15 sockpath="$cfg_chroot/$sockpath"
16 projname="${cwd#$cfg_reporoot/}"
17 else
18 projname="${cwd#/srv/git/}"
21 [ -S "$sockpath" ] || exit 0
23 while read line; do
24 echo "ref-change ${projname%.git} $line"
25 done | /bin/nc.openbsd -w 1 -U "$sockpath"
27 exit