Fix permissions/ownership for push-hosted projects
[girocco.git] / fixup.sh
blob286e225e0f5188c33ac607bc226b2a730800055c
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 cd "$proj.git"
13 xproj="$(echo "$proj" | sed 's/\./\\./g')"
14 gid="$(sed -ne "/^$xproj:/ { s/^[^:]*:[^:]*:\([0-9]*\):.*/\1/; p }")"
15 if [ "$git" = "" ]; then
16 echo "cannot resolve gid for $proj ($xproj)" >&2
17 exit 1
20 chown ."$gid" info refs objects -R
21 chmod g+w info refs objects -R