build: Fix bootstrap.bash for official source tarballs
build: Fix bootstrap.bash for official source tarballs

At the moment, bootstrap.bash assumes it is called from a git working
copy. Hence, it fails to complete when running in an unpacked official
source tarball where .git and .gitignore do not exist. This fix adds a
test for existence for .git and a -f switch for the removal of
.gitignore.

Fixes #12223

Change-Id: I7f305b83b38d5115504932bd38dadb7bdeb5d487
Reviewed-on: https://go-review.googlesource.com/13770
Reviewed-by: Dave Cheney <bfcdf3e6ca6cef45543bfbb57509c92aec9a39fb@cheney.net>
Reviewed-by: Andrew Gerrand <395a7d33bec8475c9b83b7d440f141bcbd994aa5@golang.org>

codestation/go,Pulgafree/go,yangzhongj/go,vishsingh/go,likesea/go,ObjectiveJoe/go,zhangg/go,mwhudson/go,malvira/go,zhangg/go,miolini/go,Pulgafree/go,ganboing/go-esx,stormltf/go,vishsingh/go,slavau/go,b54898533/go,snowsnail/go,rachtsingh/gogojuice,ifagnosticism/go,cloudflare/go,rentongzhang/go,cyberroadie/go,honsiorovskyi/go,theif519/go,gdey/go,Jordanzuo/go,josharian/go,CAFxX/go,deft-code/go,cyberroadie/go,vsdutka/go,yangzhongj/go,mikekap/go,arschles/go-1,yangzhongj/go,jdhenke/go,theif519/go,linux-on-ibm-z/go,danielsoro/go,NunoEdgarGub1/go,vsekhar/elastic-go,arschles/go-1,myPublicGit/go,Pulgafree/go,nawawi/go,Samurais/go,danielsoro/go,rachtsingh/gogojuice,vanloswang/go,theif519/go,ichu501/go,yasarkunduz/go,ImJasonH/go,jefby/go,ichu501/go,snowsnail/go,cyberroadie/go,linux-on-ibm-z/go,Jordanzuo/go,mdp/go,albertjin/golang-go,mikekap/go,mikekap/go,kim-racktop/go,ganboing/go-esx,yangzhongj/go,vishsingh/go,sndnvaps/go,vanloswang/go,greyhwndz/go,kim-racktop/go,derekmarcotte/go,dterei/go,vanloswang/go,4ad/go,NunoEdgarGub1/go,odeke-em/go,4ad/go,stormltf/go,alex-zhang/go,skatsuta/go,jefby/go,4ad/go,mikekap/go,codestation/go,odeke-em/go,sndnvaps/go,fjballest/golang,binarycrusader/go,mdp/go,4ad/go,momchil-velikov/go,jefby/go,odeke-em/go,arschles/golang-go,xiuzhifu/go,snowsnail/go,sndnvaps/go,roth1002/go,golang/go,dterei/go,yasarkunduz/go,rachtsingh/gogojuice,AALEKH/go,alex-zhang/go,cloudflare/go,skatsuta/go,AALEKH/go,likesea/go,stormltf/go,mgyenik/go,polyverse-security/go,derekmarcotte/go,akutz/go,myPublicGit/go,cloudflare/go,linux-on-ibm-z/go,danielsoro/go,4ad/go,binarycrusader/go,yasarkunduz/go,Samurais/go,akutz/go,samanalysis/go,ganboing/go-esx,miolini/go,NunoEdgarGub1/go,deft-code/go,vsdutka/go,greyhwndz/go,ericsnowcurrently/go,vsekhar/elastic-go,linux-on-ibm-z/go,xujianhai/go,ImJasonH/go,alex-zhang/go,nawawi/go,CarterTsai/go,skatsuta/go,vsekhar/elastic-go,xiuzhifu/go,GeorgiCodes/go,xiuzhifu/go,cloudflare/go,jefby/go,dpatel06/go,ganboing/go-esx,vanloswang/go,jacobsa/go,binarycrusader/go,dpatel06/go,sndnvaps/go,chinanjjohn2012/go,albertjin/golang-go,rentongzhang/go,joshsammut/go,GeorgiCodes/go,ichu501/go,greyhwndz/go,vanloswang/go,roth1002/go,b54898533/go,derekmarcotte/go,suncycheng/go,theif519/go,deft-code/go,odeke-em/go,malvira/go,b54898533/go,vsdutka/go,beealone/go,jdhenke/go,odeke-em/go,suncycheng/go,ericsnowcurrently/go,goodlang/good,mgyenik/go,mwhudson/go,danielsoro/go,kakuhiroshi/go,Badredapple/go,mwhudson/go,CAFxX/go,arschles/golang-go,cookerzhu/go,xujianhai/go,zhangg/go,binarycrusader/go,arschles/go-1,yasarkunduz/go,jonasi/go,fjballest/golang,Endika/go,chinanjjohn2012/go,Samurais/go,gdey/go,dterei/go,Endika/go,jdhenke/go,yasarkunduz/go,mwhudson/go,mgyenik/go,famorted/go,GeorgiCodes/go,slavau/go,Pulgafree/go,ericsnowcurrently/go,fjballest/golang,vsdutka/go,Cofyc/go,Badredapple/go,vsdutka/go,ObjectiveJoe/go,AALEKH/go,ifagnosticism/go,myPublicGit/go,codestation/go,ImJasonH/go,famorted/go,mikekap/go,golang/go,GeorgiCodes/go,akutz/go,rentongzhang/go,ImJasonH/go,kakuhiroshi/go,xiuzhifu/go,b54898533/go,zhangg/go,arschles/go-1,alex-zhang/go,skatsuta/go,momchil-velikov/go,miolini/go,Cofyc/go,cookerzhu/go,beealone/go,mgyenik/go,mdp/go,theif519/go,suncycheng/go,famorted/go,kim-racktop/go,rachtsingh/gogojuice,momchil-velikov/go,josharian/go,jonasi/go,josharian/go,jacobhaven/go,samanalysis/go,myPublicGit/go,likesea/go,likesea/go,CarterTsai/go,dterei/go,odeke-em/go,albertjin/golang-go,momchil-velikov/go,vsekhar/elastic-go,malvira/go,devpadawan/go,myPublicGit/go,akutz/go,kakuhiroshi/go,gdey/go,Badredapple/go,Jordanzuo/go,famorted/go,jacobhaven/go,greyhwndz/go,cookerzhu/go,rachtsingh/gogojuice,momchil-velikov/go,likesea/go,jacobhaven/go,codestation/go,golang/go,akutz/go,ericsnowcurrently/go,cookerzhu/go,chinanjjohn2012/go,nawawi/go,danielsoro/go,myPublicGit/go,arschles/golang-go,likesea/go,josharian/go,slavau/go,albertjin/golang-go,ichu501/go,CiscoCloud/go,josharian/go,sndnvaps/go,beealone/go,zhangg/go,joshsammut/go,CiscoCloud/go,NunoEdgarGub1/go,alex-zhang/go,jdhenke/go,akutz/go,danielsoro/go,CAFxX/go,jdhenke/go,xiuzhifu/go,ObjectiveJoe/go,alex-zhang/go,AALEKH/go,ganboing/go-esx,Samurais/go,polyverse-security/go,GeorgiCodes/go,jdhenke/go,kakuhiroshi/go,famorted/go,miolini/go,golang/go,NunoEdgarGub1/go,myPublicGit/go,chinanjjohn2012/go,rentongzhang/go,honsiorovskyi/go,kim-racktop/go,jacobsa/go,Samurais/go,vsdutka/go,honsiorovskyi/go,yangzhongj/go,Badredapple/go,Endika/go,miolini/go,kim-racktop/go,yasarkunduz/go,goodlang/good,rentongzhang/go,dpatel06/go,snowsnail/go,fjballest/golang,gdey/go,vsekhar/elastic-go,gdey/go,danielsoro/go,nawawi/go,CiscoCloud/go,CiscoCloud/go,joshsammut/go,CiscoCloud/go,Cofyc/go,snowsnail/go,mwhudson/go,Samurais/go,momchil-velikov/go,chinanjjohn2012/go,nawawi/go,skatsuta/go,samanalysis/go,theif519/go,vanloswang/go,jacobsa/go,rentongzhang/go,albertjin/golang-go,vanloswang/go,sndnvaps/go,zhangg/go,xiuzhifu/go,ichu501/go,greyhwndz/go,derekmarcotte/go,alex-zhang/go,cyberroadie/go,Cofyc/go,goodlang/good,jacobsa/go,CAFxX/go,ifagnosticism/go,xujianhai/go,rachtsingh/gogojuice,derekmarcotte/go,myPublicGit/go,theass/go,nawawi/go,fjballest/golang,cloudflare/go,vanloswang/go,dpatel06/go,cyberroadie/go,dpatel06/go,xujianhai/go,AALEKH/go,theass/go,devpadawan/go,ichu501/go,roth1002/go,samanalysis/go,xujianhai/go,Cofyc/go,fjballest/golang,stormltf/go,arschles/go-1,roth1002/go,josharian/go,malvira/go,CarterTsai/go,ImJasonH/go,vishsingh/go,akutz/go,honsiorovskyi/go,binarycrusader/go,binarycrusader/go,jacobhaven/go,roth1002/go,cloudflare/go,deft-code/go,cyberroadie/go,beealone/go,cloudflare/go,samanalysis/go,Badredapple/go,mgyenik/go,beealone/go,yangzhongj/go,slavau/go,albertjin/golang-go,ichu501/go,kim-racktop/go,cookerzhu/go,CiscoCloud/go,4ad/go,snowsnail/go,Pulgafree/go,CarterTsai/go,miolini/go,greyhwndz/go,devpadawan/go,chinanjjohn2012/go,jonasi/go,josharian/go,arschles/go-1,golang/go,cookerzhu/go,ericsnowcurrently/go,vsdutka/go,sndnvaps/go,goodlang/good,skatsuta/go,danielsoro/go,vishsingh/go,arschles/golang-go,famorted/go,Pulgafree/go,vsekhar/elastic-go,fjballest/golang,suncycheng/go,Endika/go,jacobsa/go,Badredapple/go,theass/go,arschles/go-1,likesea/go,derekmarcotte/go,theif519/go,honsiorovskyi/go,mikekap/go,suncycheng/go,xiuzhifu/go,deft-code/go,rentongzhang/go,CarterTsai/go,jonasi/go,golang/go,goodlang/good,jacobsa/go,ImJasonH/go,dterei/go,linux-on-ibm-z/go,honsiorovskyi/go,malvira/go,mwhudson/go,dterei/go,dterei/go,deft-code/go,ObjectiveJoe/go,codestation/go,samanalysis/go,zhangg/go,Cofyc/go,kim-racktop/go,beealone/go,malvira/go,likesea/go,NunoEdgarGub1/go,samanalysis/go,ericsnowcurrently/go,theass/go,Cofyc/go,suncycheng/go,4ad/go,slavau/go,jdhenke/go,xujianhai/go,kakuhiroshi/go,joshsammut/go,Badredapple/go,mikekap/go,CarterTsai/go,nawawi/go,CAFxX/go,arschles/golang-go,odeke-em/go,akutz/go,CiscoCloud/go,stormltf/go,polyverse-security/go,jacobhaven/go,miolini/go,suncycheng/go,ifagnosticism/go,AALEKH/go,arschles/golang-go,ifagnosticism/go,alex-zhang/go,rachtsingh/gogojuice,ericsnowcurrently/go,christopher-henderson/Go,CAFxX/go,fjballest/golang,ifagnosticism/go,mwhudson/go,jacobsa/go,polyverse-security/go,kim-racktop/go,jonasi/go,gdey/go,jefby/go,NunoEdgarGub1/go,vsekhar/elastic-go,ObjectiveJoe/go,arschles/golang-go,dpatel06/go,CarterTsai/go,vsdutka/go,joshsammut/go,gdey/go,Cofyc/go,chinanjjohn2012/go,Jordanzuo/go,jacobhaven/go,beealone/go,devpadawan/go,GeorgiCodes/go,slavau/go,mgyenik/go,yangzhongj/go,theass/go,malvira/go,devpadawan/go,jonasi/go,ganboing/go-esx,skatsuta/go,polyverse-security/go,cookerzhu/go,joshsammut/go,zhangg/go,chinanjjohn2012/go,mgyenik/go,derekmarcotte/go,snowsnail/go,cookerzhu/go,polyverse-security/go,deft-code/go,jacobsa/go,slavau/go,Samurais/go,malvira/go,jonasi/go,binarycrusader/go,NunoEdgarGub1/go,AALEKH/go,kakuhiroshi/go,kakuhiroshi/go,suncycheng/go,CAFxX/go,dterei/go,nawawi/go,arschles/go-1,goodlang/good,ganboing/go-esx,mdp/go,theass/go,b54898533/go,sndnvaps/go,jefby/go,rentongzhang/go,jacobhaven/go,stormltf/go,ericsnowcurrently/go,vishsingh/go,jdhenke/go,Jordanzuo/go,4ad/go,joshsammut/go,josharian/go,albertjin/golang-go,albertjin/golang-go,snowsnail/go,famorted/go,xujianhai/go,xujianhai/go,greyhwndz/go,b54898533/go,codestation/go,theass/go,codestation/go,Endika/go,mwhudson/go,Endika/go,devpadawan/go,arschles/golang-go,ifagnosticism/go,ichu501/go,devpadawan/go,ImJasonH/go,rachtsingh/gogojuice,Pulgafree/go,cloudflare/go,slavau/go,mdp/go,mgyenik/go,beealone/go,Endika/go,CiscoCloud/go,Jordanzuo/go,Endika/go,skatsuta/go,golang/go,ObjectiveJoe/go,stormltf/go,CarterTsai/go,dpatel06/go,honsiorovskyi/go,vishsingh/go,mikekap/go,xiuzhifu/go,mdp/go,codestation/go,golang/go,goodlang/good,momchil-velikov/go,linux-on-ibm-z/go,goodlang/good,GeorgiCodes/go,GeorgiCodes/go,cyberroadie/go,polyverse-security/go,deft-code/go,ImJasonH/go,roth1002/go,devpadawan/go,joshsammut/go,Pulgafree/go,famorted/go,dpatel06/go,Samurais/go,derekmarcotte/go,b54898533/go,vsekhar/elastic-go,cyberroadie/go,odeke-em/go,AALEKH/go,jefby/go,mdp/go,ObjectiveJoe/go,theass/go,linux-on-ibm-z/go,stormltf/go,CAFxX/go,ifagnosticism/go,b54898533/go,jonasi/go,mdp/go,linux-on-ibm-z/go,yasarkunduz/go,miolini/go,samanalysis/go,yasarkunduz/go,kakuhiroshi/go,Jordanzuo/go,theif519/go,Jordanzuo/go,jacobhaven/go,gdey/go,ganboing/go-esx,momchil-velikov/go,binarycrusader/go,Badredapple/go,polyverse-security/go,jefby/go,greyhwndz/go,vishsingh/go,roth1002/go,ObjectiveJoe/go,honsiorovskyi/go,yangzhongj/go,roth1002/go