dockerfiles/gitolite-stagit/bin/set-owner

17 lines
348 B
Bash

#!/bin/sh
set -e
[ -z "$1" ] && exit 0
GL_REPO_BASE="${GL_REPO_BASE:-/var/lib/git/repositories}"
owner_file="${GL_REPO_BASE}/${1}.git/owner"
if owner=$(gitolite git-config "${1}" gitweb.owner); then
echo "setting owner for '${1}'"
echo "${owner}" > "${owner_file}"
else
echo "usetting owner for '${1}'"
rm -f "${owner_file}"
fi