I bring out updates for the repo with a "separate work tree" from which Apache maintains its files. Using the post-receive script hook I need a list of modified files to update their permissions, as our suphp requires. However, this does not work. Any ideas why not?
GIT_WORK_TREE=/srv/www/live/ files=`git diff ..FETCH_HEAD --name-only --diff-filter=ACMRTUXB` GIT_WORK_TREE=/srv/www/live/ sudo -u www-run /usr/bin/git checkout -f for file in $files do if [[ $file == *.php ]] then chmod 600 $file else chmod 644 $file fi done
Content .git / config
[core] repositoryformatversion = 0 filemode = true bare = false logallrefupdates = true sharedrepository = 1 worktree = /srv/www/live/ [receive] denyNonFastforwards = true denycurrentbranch = ignore
source share