Always update-server-info after repacking
[girocco/ztw.git] / updatecheck.sh
blob67be2d337b4b643a197e3726af84c8ccfb4016b7
1 #!/bin/bash
3 if [ -e /tmp/gitupdatelock ]; then
4 echo "Locked!" >&2
5 exit 1
6 fi
7 touch /tmp/gitupdatelock
9 cd /srv/git
10 find . -name base_url | cut -c 3- | sed -e 's/\/base_url$//' |
11 while read dir; do
12 if [ -e "$dir"/.nofetch ]; then
13 (cd "$dir/objects" && [ "$(ls ?? 2>/dev/null)" ] && GIT_DIR=".." git repack -a -d)
14 GIT_DIR=".." bang git update-server-info
15 else
16 /home/repo/repomgr/update.sh "${dir%.git}"
18 done
20 rm /tmp/gitupdatelock