doctor: only check git status if repository exists
doctor: only check git status if repository exists

Closes Homebrew/homebrew#7722.

Signed-off-by: Jack Nagel <43386ce32af96f5c56f2a88e458cb94cebee3751@gmail.com>

vitorgalvao/brew,JCount/brew,sjackman/homebrew,reelsense/brew,pseudocody/brew,gordonmcshane/homebrew,tonyg/homebrew,mgrimes/brew,MikeMcQuaid/brew,amar-laksh/brew_sudo,JCount/brew,tonyg/homebrew,nandub/brew,aw1621107/brew,nandub/brew,sjackman/homebrew,MikeMcQuaid/brew,Homebrew/brew,konqui/brew,zmwangx/brew,toonetown/homebrew,gordonmcshane/homebrew,claui/brew,mahori/brew,zmwangx/brew,aw1621107/brew,palxex/brew,muellermartin/dist,muellermartin/dist,bfontaine/brew,rwhogg/brew,alyssais/brew,bfontaine/brew,Homebrew/brew,claui/brew,sjackman/homebrew,staticfloat/brew,maxim-belkin/brew,Linuxbrew/brew,Homebrew/brew,DomT4/brew,vitorgalvao/brew,konqui/brew,rwhogg/brew,reitermarkus/brew,maxim-belkin/brew,amar-laksh/brew_sudo,jmsundar/brew,mahori/brew,reitermarkus/brew,DomT4/brew,EricFromCanada/brew,gregory-nisbet/brew,jmsundar/brew,hanxue/linuxbrew,alyssais/brew,reelsense/brew,vitorgalvao/brew,zmwangx/brew,nandub/brew,EricFromCanada/brew,konqui/brew,Linuxbrew/brew,Linuxbrew/brew,staticfloat/brew,DomT4/brew,tonyg/homebrew,DomT4/brew,AnastasiaSulyagina/brew,JCount/brew,AnastasiaSulyagina/brew,palxex/brew,nandub/brew,MikeMcQuaid/brew,toonetown/homebrew,pseudocody/brew,sjackman/homebrew,vitorgalvao/brew,mahori/brew,gordonmcshane/homebrew,AnastasiaSulyagina/brew,muellermartin/dist,Homebrew/brew,konqui/brew,ilovezfs/brew,alyssais/brew,toonetown/homebrew,hanxue/linuxbrew,reelsense/brew,reitermarkus/brew,ilovezfs/brew,mgrimes/brew,bfontaine/brew,jmsundar/brew,EricFromCanada/brew,mistydemeo/homebrew,MikeMcQuaid/brew,mgrimes/brew,staticfloat/brew,pseudocody/brew,mahori/brew,claui/brew,mistydemeo/homebrew,JCount/brew,aw1621107/brew,hanxue/linuxbrew,ilovezfs/brew,rwhogg/brew,reitermarkus/brew,palxex/brew,Linuxbrew/brew,gregory-nisbet/brew,maxim-belkin/brew,amar-laksh/brew_sudo,EricFromCanada/brew,claui/brew,mistydemeo/homebrew,gregory-nisbet/brew