Add excused to ensure follows.
[git-central.git] / server / update-git-config
1 #!/bin/sh
2
3 refname="$1"
4 oldrev="$2"
5 newrev="$3"
6
7 if [ "$refname" != "refs/heads/gitconfig" ] ; then
8         exit 0
9 fi
10
11 tree_contents=$(git ls-tree $newrev)
12 if [[ "$tree_contents" =~ (.{40})[[:space:]]config ]] ; then
13         config_hash=${BASH_REMATCH[1]}
14         echo "hash=$config_hash"
15         git cat-file blob "$config_hash" | while read line ; do
16                 key="${line%=*}"
17                 value="${line#*=}"
18                 git config "${key}" "${value}"
19         done
20 fi
21