Perform clone in $reporoot
[girocco/mytab.git] / jobs / fixup.sh
blob7a5a1801bcd8f8b69743f21bc95ac42f028ffb97
1 #!/bin/bash
3 # THIS SCRIPT IS BEING RUN UNDER ROOT!!!
5 # [repo.or.cz] You will need to manually update this file if you modify
6 # it in the repository.
8 set -e
10 proj="$1"
11 groupfile="$2"
12 mirroruser="$3"
13 cd "$proj.git"
15 chmod ug+rw,o+r . -R 2>&1 | (grep -v 'No such file or directory' || true)
17 [ -e .nofetch ] || exit
19 xproj="$(echo "$proj" | sed 's/[.\/]/\\&/g')"
20 gid="$(sed -ne "/^$xproj:/ { s/^[^:]*:[^:]*:\([0-9]*\):.*/\1/; p }" "$groupfile")"
21 if [ "$gid" = "" ]; then
22 #echo "cannot resolve gid for $proj ($xproj)" >&2
23 exit 1
26 chown "$mirror_user"."$gid" info refs objects -R 2>&1 | (grep -v 'No such file or directory' || true)