according to article at digitalocean instead of GIT_WORK_TREE you need a combo of --work-tree and --git-dir options:
git --work-tree=/var/www/html --git-dir=/home/demo/proj checkout -f
and for post-receive script it ends up being slightly different construct than what you have:
#!/bin/bash
while read oldrev newrev ref
do
if [[ $ref =~ .*/master$ ]];
then
git --work-tree=/var/www/html --git-dir=/home/demo/proj checkout -f
fi
done