Only clone with a depth when targeting HEAD or a tag.
Only clone with a depth when targeting HEAD or a tag.

Closes Homebrew/homebrew#7101.

Signed-off-by: Max Howell <0706025b2bbcec1ed8d64822f4eccd96314938d0@methylblue.com>

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