update: use GitHub API to avoid unneeded fetches.
update: use GitHub API to avoid unneeded fetches.

Check to see if `HEAD` is the same as what we have locally. If it is:
don't bother to `git fetch`.

Closes Homebrew/homebrew#47888.

Closes Homebrew/homebrew#49219.

Signed-off-by: Mike McQuaid <a17fed27eaa842282862ff7c1b9c8395a26ac320@mikemcquaid.com>

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