CGI和命令行上的Git Pull有不同的结果

我在GitHub上有一个“推后”webhook,它调用一个CGI脚本来更新一个Jekyll网站。

剧本:

user@server [~/_repo]# cat cgi-bin/githook.cgi #!/bin/bash echo Content-type: text/plain echo if [ -z "$HOME" ] ; then HOME=/home/user fi GIT_REPO=$HOME/_repo PUBLIC_WWW=$HOME/public_html pushd $GIT_REPO git pull echo "$HOME/.rvm/bin/ts_jekyll build --source $GIT_REPO --destination $PUBLIC_WWW" $HOME/.rvm/bin/ts_jekyll build --source $GIT_REPO --destination $PUBLIC_WWW popd echo DONE 

GitHub将脚本的输出保存为:

 ~/_repo ~/public_html/cgi-bin Updating OLD_COMMIT_SHA..NEW_COMMIT_SHA /home/user/.rvm/bin/ts_jekyll build --source /home/user/_repo/ --destination /home/user/public_html Configuration file: /home/user/_repo/_config.yml Source: /home/user/_repo/ Destination: /home/user/public_html Generating... done. Auto-regeneration: disabled. Use --watch to enable. ~/public_html/cgi-bin DONE 

这是我期待的输出,但该网站没有更新。
当我用SSHlogin并运行user@server [~]# _repo/cgi-bin/githook.cgi ,我通常会再次得到完全相同的输出,并且正确更新站点。

如果我对本地副本进行了更改,则Web钩子仍然可以正常工作(即使不应该),并且命令行上的版本会显示关于覆盖本地更改的相应消息。

有什么可能导致这种情况发生?