Convert git config over to a post receive script.
[git-central.git] / server / post-receive-git-config
1 #!/bin/sh
2
3 while read oldrev newrev refname ; do
4         if [ "$refname" == "refs/heads/gitconfig" ] ; then
5                 config_hash=$(git ls-tree $newrev | grep config | gawk '{print $3}')
6                 if [[ "$config_hash" != "" ]] ; then
7                         git cat-file blob "$config_hash" | while read line ; do
8                                 key="${line%=*}"
9                                 value="${line#*=}"
10                                 git config "${key}" "${value}"
11                         done
12                 fi
13         fi
14 done
15