Fix edge case: app directory is created before first app push
Fix edge case: app directory is created before first app push

When an app directory (i.e. `/home/dokku/myapp`) is created before the
app is pushed for the first time (which may occur if config files such
as `ENV` are added before the initial push), then the app directory will
not be initialized to a bare git repo nor will the pre-receive hook be
installed because `plugins/git/commands` assumes that if `$APP_PATH`
exists, then the directory must also be git initialized too. This fix
checks for `$APP_PATH/refs` instead.

gdi2290/dokku,expa/dokku,vkurup/dokku,crisward/dokku,nnnnathann/dokku,stnly/dokku-alt,econya/dokku,mikexstudios/dokku,3onyc/dokku,vijayviji/dokku,ddreaml/dokku,Evlos/dokku,nnnnathann/dokku,barseghyanartur/dokku,codeconfab/dokku,fkowal/dokku,jamesmarva/dokku,mehulsbhatt/dokku-alt,aydintd/dokku,callahad/dokku,Evlos/dokku,henrik/dokku,vfulco/dokku-alt,mjmeintjes/dokku,basicer/dokku,beedesk/dokku-alt,davidsiefert/dokku,Fab-IT-ApS/dokku,Git-Host/dokku,jimeh/dokku,alessio/dokku,mehulsbhatt/dokku-alt,arsthanea/dokku,eleventigers/dokku,Cactusbone/dokku,akatrevorjay/dokku,codeconfab/dokku,fmoliveira/dokku,RsrchBoy/dokku,stepri/dokku,omeid/dokku,bewest/dokku-alt,eljojo/dokku,hanwoody/dokku,netbrick/dokku-alt,ertrzyiks/dokku,mlebkowski/dokku,lonnen/davis-ci,TribeMedia/dokku,lonnen/davis-ci,mehulsbhatt/dokku-alt,gdi2290/dokku,mvberg/dokku,Cactusbone/dokku,gdi2290/dokku,ddreaml/dokku,fruitl00p/dokku,beedesk/dokku-alt,claytonbrown/dokku,hanwoody/dokku,sseemayer/dokku,jazzzz/dokku,gdi2290/dokku,leonardodino/dokku,mrluc/dokku,mlebkowski/dokku,yuvadm/dokku-base,vfulco/dokku-alt,tilgovi/dokku,jimeh/dokku,vijayviji/dokku,bogdal/dokku,mrluc/dokku,jvanbaarsen/dokku,expa/dokku,davidsiefert/dokku,ayufan/dokku,mouserage/dokku,zimbatm/dokku,basicer/dokku,elia/dokku,ignlg/dokku,claytonbrown/dokku,yuvadm/dokku-base,hanwoody/dokku,mmerickel/dokku,vkurup/dokku,arthurschreiber/dokku,Evlos/dokku,suxor42/dokku,ryana/dokku,stnly/dokku-alt,lmars/dokku,mlebkowski/dokku,rocLv/dokku,pmvieira/dokku,ignlg/dokku,bobvanderlinden/dokku,callahad/dokku,paralin/crew,bogdal/dokku,ksokhan/dokku,experimental-platform/dokku,emdantrim/dokku,fruitl00p/dokku,jimeh/dokku,expa/dokku,F4-Group/dokku,henrik/dokku,plietar/dokku,u2mejc/dokku,beedesk/dokku-alt,akatrevorjay/dokku,netbrick/dokku-alt,ddreaml/dokku,callahad/dokku,klodoo/dokku,mmerickel/dokku,RsrchBoy/dokku,Git-Host/dokku,omeid/dokku,matto1990/dokku,dokku-alt/dokku-alt,jamesblunt/dokku,biddyweb/dokku,netbrick/dokku,netbrick/dokku,zimbatm/dokku,dsrowell/dokku-alt,stepri/dokku,omeid/dokku,alessio/dokku,jimeh/dokku,lmars/dokku,beni55/dokku,elia/dokku,bewest/dokku-alt,hbouvier/dokku,3onyc/dokku,jazzzz/dokku,silasb/dokku,mehulsbhatt/dokku-alt,vlipco/dokku,matto1990/dokku,hbouvier/dokku,emdantrim/dokku,bobvanderlinden/dokku,aydintd/dokku,experimental-platform/dokku,gianpaj/dokku,F4-Group/dokku,ebeigarts/dokku,netbrick/dokku,mouserage/dokku,kennetham/dokku,progrium/dokku,mmerickel/dokku,yuvadm/dokku-base,aydintd/dokku,u2mejc/dokku,ertrzyiks/dokku,AnselZhangGit/dokku,basicer/dokku,mlebkowski/dokku,lonnen/davis-ci,tilgovi/dokku,crisward/dokku,stenius/dokku,henrik/dokku,bewest/dokku-alt,mjmeintjes/dokku,akatrevorjay/dokku,Cactusbone/dokku,amaltson/dokku,experimental-platform/dokku,jazzzz/dokku,jimjag/dokku,fruitl00p/dokku,mjmeintjes/dokku,silasb/dokku,dokku-alt/dokku-alt,arthurschreiber/dokku,matto1990/dokku,jimjag/dokku,arsthanea/dokku,lonnen/davis-ci,TribeMedia/dokku,mikexstudios/dokku,jvanbaarsen/dokku,banyan/dokku,lemmycaution/dokku,expa/dokku,vfulco/dokku-alt,jimjag/dokku,barseghyanartur/dokku,RsrchBoy/dokku,lonnen/davis-ci,gdi2290/dokku,experimental-platform/dokku,yuvadm/dokku-base,F4-Group/dokku,nnnnathann/dokku,sebastianscatularo/dokku,beedesk/dokku-alt,arthurschreiber/dokku,jimeh/dokku,bobvanderlinden/dokku,dokku/dokku,mehulsbhatt/dokku-alt,beedesk/dokku,emdantrim/dokku,basicer/dokku,emdantrim/dokku,alessio/dokku,Git-Host/dokku,mikexstudios/dokku,mouserage/dokku,johnfraney/dokku,sseemayer/dokku,mouserage/dokku,netbrick/dokku-alt,callahad/dokku,expa/dokku,zimbatm/dokku,davidsiefert/dokku,frog/dokku,RsrchBoy/dokku,mehulsbhatt/dokku-alt,u2mejc/dokku,ertrzyiks/dokku,vijayviji/dokku,amaltson/dokku,dsrowell/dokku-alt,mlebkowski/dokku,lemmycaution/dokku,codeconfab/dokku,yuvadm/dokku-base,jimjag/dokku,lemmycaution/dokku,eljojo/dokku,emdantrim/dokku,arsthanea/dokku,amaltson/dokku,sebastianscatularo/dokku,alexquick/dokku,akatrevorjay/dokku,bkniffler/dokku,basicer/dokku,yuvadm/dokku-base,aydintd/dokku,econya/dokku,bkniffler/dokku,Cactusbone/dokku,cjblomqvist/dokku,AnselZhangGit/dokku,leonardodino/dokku,jamesmarva/dokku,dokku-alt/dokku-alt,u2mejc/dokku,bewest/dokku-alt,bogdal/dokku,mjmeintjes/dokku,netbrick/dokku-alt,mvberg/dokku,econya/dokku,bobvanderlinden/dokku,akatrevorjay/dokku,jamesmarva/dokku,dokku/dokku,progrium/dokku,Git-Host/dokku,ryana/dokku,fkowal/dokku,jvanbaarsen/dokku,bkniffler/dokku,pmvieira/dokku,johnfraney/dokku,akatrevorjay/dokku,ertrzyiks/dokku,econya/dokku,bewest/dokku-alt,rocLv/dokku,lmars/dokku,Evlos/dokku,banyan/dokku,claytonbrown/dokku,gabrielrios/dokku,eljojo/dokku,biddyweb/dokku,Fab-IT-ApS/dokku,vkurup/dokku,bobvanderlinden/dokku,jamesblunt/dokku,klodoo/dokku,stepri/dokku,arthurschreiber/dokku,dsrowell/dokku-alt,johnfraney/dokku,AnselZhangGit/dokku,mouserage/dokku,jazzzz/dokku,3onyc/dokku,sebastianscatularo/dokku,leonardodino/dokku,pmvieira/dokku,RsrchBoy/dokku,banyan/dokku,Git-Host/dokku,vlipco/dokku,u2mejc/dokku,omeid/dokku,Fab-IT-ApS/dokku,eljojo/dokku,elia/dokku,mvberg/dokku,fkowal/dokku,ebeigarts/dokku,klodoo/dokku,basicer/dokku,ryana/dokku,crisward/dokku,alessio/dokku,F4-Group/dokku,ksokhan/dokku,F4-Group/dokku,mjmeintjes/dokku,stnly/dokku-alt,sseemayer/dokku,beedesk/dokku,Evlos/dokku,frog/dokku,netbrick/dokku,fmoliveira/dokku,econya/dokku,basicer/dokku,ryana/dokku,nnnnathann/dokku,kennetham/dokku,davidsiefert/dokku,bewest/dokku,Git-Host/dokku,alessio/dokku,vkurup/dokku,AnselZhangGit/dokku,banyan/dokku,mmerickel/dokku,ertrzyiks/dokku,callahad/dokku,crisward/dokku,mlebkowski/dokku,vlipco/dokku,vlipco/dokku,matto1990/dokku,davidsiefert/dokku,suxor42/dokku,mrluc/dokku,jimeh/dokku,matto1990/dokku,ayufan/dokku,dokku-alt/dokku-alt,codeconfab/dokku,klodoo/dokku,rocLv/dokku,fmoliveira/dokku,frog/dokku,emdantrim/dokku,stnly/dokku-alt,plietar/dokku,crisward/dokku,eleventigers/dokku,Evlos/dokku,dsrowell/dokku-alt,rocLv/dokku,ignlg/dokku,lmars/dokku,Fab-IT-ApS/dokku,jamesblunt/dokku,ksokhan/dokku,frog/dokku,henrik/dokku,netbrick/dokku-alt,jvanbaarsen/dokku,codeconfab/dokku,plietar/dokku,klodoo/dokku,crisward/dokku,Cactusbone/dokku,tilgovi/dokku,vkurup/dokku,barseghyanartur/dokku,emdantrim/dokku,codeconfab/dokku,claytonbrown/dokku,arsthanea/dokku,vijayviji/dokku,cjblomqvist/dokku,vkurup/dokku,klodoo/dokku,claytonbrown/dokku,beedesk/dokku,akatrevorjay/dokku,F4-Group/dokku,progrium/dokku,sebastianscatularo/dokku,yuvadm/dokku-base,ksokhan/dokku,gianpaj/dokku,Fab-IT-ApS/dokku,ertrzyiks/dokku,TribeMedia/dokku,Cactusbone/dokku,fkowal/dokku,3onyc/dokku,biddyweb/dokku,emdantrim/dokku,vfulco/dokku-alt,dokku/dokku,kennetham/dokku,bewest/dokku,mvberg/dokku,gabrielrios/dokku,elia/dokku,johnfraney/dokku,dsrowell/dokku-alt,gdi2290/dokku,jamesblunt/dokku,ayufan/dokku,davidsiefert/dokku,alexquick/dokku,jimjag/dokku,vijayviji/dokku,beedesk/dokku,alexquick/dokku,fmoliveira/dokku,3onyc/dokku,TribeMedia/dokku,barseghyanartur/dokku,jamesblunt/dokku,omeid/dokku,expa/dokku,ebeigarts/dokku,amaltson/dokku,eljojo/dokku,stepri/dokku,silasb/dokku,ebeigarts/dokku,elia/dokku,fruitl00p/dokku,vlipco/dokku,TribeMedia/dokku,gabrielrios/dokku,johnfraney/dokku,arsthanea/dokku,jazzzz/dokku,leonardodino/dokku,lmars/dokku,mlebkowski/dokku,gdi2290/dokku,Cactusbone/dokku,plietar/dokku,ignlg/dokku,omeid/dokku,aydintd/dokku,basicer/dokku,eleventigers/dokku,alexquick/dokku,progrium/dokku,lonnen/davis-ci,u2mejc/dokku,codeconfab/dokku,henrik/dokku,hbouvier/dokku,jimjag/dokku,mrluc/dokku,dokku-alt/dokku-alt,arthurschreiber/dokku,Git-Host/dokku,silasb/dokku,sebastianscatularo/dokku,stenius/dokku,beni55/dokku,jamesmarva/dokku,nnnnathann/dokku,pmvieira/dokku,elia/dokku,bewest/dokku,sebastianscatularo/dokku,arthurschreiber/dokku,jamesmarva/dokku,jimjag/dokku,cjblomqvist/dokku,beedesk/dokku,alessio/dokku,vkurup/dokku,beedesk/dokku-alt,ayufan/dokku,gianpaj/dokku,leonardodino/dokku,econya/dokku,beedesk/dokku-alt,johnfraney/dokku,beedesk/dokku-alt,mikexstudios/dokku,TribeMedia/dokku,dokku/dokku,eleventigers/dokku,rocLv/dokku,sebastianscatularo/dokku,ebeigarts/dokku,klodoo/dokku,ryana/dokku,sseemayer/dokku,stenius/dokku,F4-Group/dokku,beni55/dokku,ebeigarts/dokku,3onyc/dokku,ayufan/dokku,biddyweb/dokku,stnly/dokku-alt,mrluc/dokku,Evlos/dokku,kennetham/dokku,alexquick/dokku,beedesk/dokku,mouserage/dokku,ksokhan/dokku,bobvanderlinden/dokku,RsrchBoy/dokku,silasb/dokku,mouserage/dokku,biddyweb/dokku,kennetham/dokku,bobvanderlinden/dokku,hanwoody/dokku,progrium/dokku,hanwoody/dokku,eljojo/dokku,netbrick/dokku,tilgovi/dokku,gianpaj/dokku,cjblomqvist/dokku,elia/dokku,bewest/dokku,lonnen/davis-ci,bkniffler/dokku,rocLv/dokku,lemmycaution/dokku,biddyweb/dokku,tilgovi/dokku,bewest/dokku,bewest/dokku-alt,lmars/dokku,stnly/dokku-alt,hanwoody/dokku,gabrielrios/dokku,frog/dokku,mikexstudios/dokku,mvberg/dokku,arthurschreiber/dokku,arsthanea/dokku,eljojo/dokku,AnselZhangGit/dokku,kennetham/dokku,netbrick/dokku,leonardodino/dokku,jamesmarva/dokku,vlipco/dokku,progrium/dokku,fkowal/dokku,jamesblunt/dokku,bewest/dokku-alt,bkniffler/dokku,jamesmarva/dokku,nnnnathann/dokku,ebeigarts/dokku,AnselZhangGit/dokku,johnfraney/dokku,mouserage/dokku,aydintd/dokku,ddreaml/dokku,elia/dokku,dokku-alt/dokku-alt,crisward/dokku,beedesk/dokku,vlipco/dokku,jvanbaarsen/dokku,sseemayer/dokku,fruitl00p/dokku,davidsiefert/dokku,pmvieira/dokku,mehulsbhatt/dokku-alt,dokku/dokku,amaltson/dokku,zimbatm/dokku,dokku-alt/dokku-alt,experimental-platform/dokku,stnly/dokku-alt,klodoo/dokku,lemmycaution/dokku,ddreaml/dokku,lmars/dokku,arsthanea/dokku,bkniffler/dokku,u2mejc/dokku,AnselZhangGit/dokku,bkniffler/dokku,Fab-IT-ApS/dokku,netbrick/dokku,ignlg/dokku,progrium/dokku,stepri/dokku,eleventigers/dokku,alessio/dokku,banyan/dokku,Fab-IT-ApS/dokku,suxor42/dokku,matto1990/dokku,tilgovi/dokku,expa/dokku,matto1990/dokku,gabrielrios/dokku,gianpaj/dokku,amaltson/dokku,omeid/dokku,bogdal/dokku,leonardodino/dokku,econya/dokku,hbouvier/dokku,ayufan/dokku,netbrick/dokku-alt,plietar/dokku,jvanbaarsen/dokku,beedesk/dokku,vijayviji/dokku,beni55/dokku,fkowal/dokku,RsrchBoy/dokku,cjblomqvist/dokku,suxor42/dokku,amaltson/dokku,alexquick/dokku,jimeh/dokku,3onyc/dokku,alexquick/dokku,bewest/dokku,stenius/dokku,jazzzz/dokku,banyan/dokku,dokku/dokku,bogdal/dokku,ayufan/dokku,Git-Host/dokku,mrluc/dokku,dokku/dokku,jazzzz/dokku,henrik/dokku,stenius/dokku,experimental-platform/dokku,Cactusbone/dokku,arthurschreiber/dokku,barseghyanartur/dokku,eljojo/dokku,TribeMedia/dokku,gianpaj/dokku,beni55/dokku,lmars/dokku,stenius/dokku,vijayviji/dokku,ddreaml/dokku,mmerickel/dokku,beni55/dokku,suxor42/dokku,fkowal/dokku,stnly/dokku-alt,cjblomqvist/dokku,banyan/dokku,gabrielrios/dokku,suxor42/dokku,biddyweb/dokku,beni55/dokku,jimeh/dokku,mjmeintjes/dokku,vfulco/dokku-alt,hbouvier/dokku,Fab-IT-ApS/dokku,rocLv/dokku,bogdal/dokku,callahad/dokku,dsrowell/dokku-alt,AnselZhangGit/dokku,bewest/dokku-alt,fmoliveira/dokku,suxor42/dokku,fmoliveira/dokku,omeid/dokku,ksokhan/dokku,vfulco/dokku-alt,ignlg/dokku,matto1990/dokku,jamesblunt/dokku,kennetham/dokku,barseghyanartur/dokku,sseemayer/dokku,mrluc/dokku,bkniffler/dokku,mmerickel/dokku,dokku-alt/dokku-alt,expa/dokku,jvanbaarsen/dokku,callahad/dokku,suxor42/dokku,stepri/dokku,vfulco/dokku-alt,arsthanea/dokku,dokku/dokku,jazzzz/dokku,mvberg/dokku,barseghyanartur/dokku,fruitl00p/dokku,bogdal/dokku,vijayviji/dokku,eleventigers/dokku,netbrick/dokku-alt,u2mejc/dokku,ddreaml/dokku,mvberg/dokku,silasb/dokku,stepri/dokku,claytonbrown/dokku,ignlg/dokku,3onyc/dokku,vfulco/dokku-alt,vlipco/dokku,cjblomqvist/dokku,plietar/dokku,claytonbrown/dokku,alexquick/dokku,fruitl00p/dokku,zimbatm/dokku,nnnnathann/dokku,lemmycaution/dokku,davidsiefert/dokku,ebeigarts/dokku,ddreaml/dokku,lemmycaution/dokku,hanwoody/dokku,codeconfab/dokku,aydintd/dokku,fruitl00p/dokku,stepri/dokku,plietar/dokku,leonardodino/dokku,ertrzyiks/dokku,netbrick/dokku-alt,mjmeintjes/dokku,F4-Group/dokku,jamesmarva/dokku,barseghyanartur/dokku,hanwoody/dokku,sebastianscatularo/dokku,ryana/dokku,bobvanderlinden/dokku,ertrzyiks/dokku,claytonbrown/dokku,amaltson/dokku,vkurup/dokku,hbouvier/dokku,tilgovi/dokku,zimbatm/dokku,Evlos/dokku,dsrowell/dokku-alt,mikexstudios/dokku,mehulsbhatt/dokku-alt,ksokhan/dokku,mikexstudios/dokku,rocLv/dokku,alessio/dokku,henrik/dokku,zimbatm/dokku,experimental-platform/dokku,jimjag/dokku,eleventigers/dokku,sseemayer/dokku,pmvieira/dokku,mrluc/dokku,bewest/dokku,akatrevorjay/dokku,hbouvier/dokku,econya/dokku,mmerickel/dokku,henrik/dokku,beni55/dokku,kennetham/dokku,experimental-platform/dokku,pmvieira/dokku,beedesk/dokku-alt,gianpaj/dokku,frog/dokku,paralin/crew,biddyweb/dokku,tilgovi/dokku,progrium/dokku,fmoliveira/dokku,johnfraney/dokku,TribeMedia/dokku,netbrick/dokku,sseemayer/dokku,fmoliveira/dokku,frog/dokku,stenius/dokku,cjblomqvist/dokku,pmvieira/dokku,silasb/dokku,gabrielrios/dokku,callahad/dokku,ryana/dokku,gabrielrios/dokku,gianpaj/dokku,crisward/dokku,dsrowell/dokku-alt,mmerickel/dokku