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 #47888.

Closes #49219.

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

hanxue/homebrew,cscetbon/homebrew,esamson/homebrew,optikfluffel/homebrew,liamstask/homebrew,AlexejK/homebrew,ExtremeMan/homebrew,kevinastone/homebrew,optikfluffel/homebrew,BrewTestBot/homebrew,skinny-framework/homebrew,booi/homebrew,getgauge/homebrew,DoomHammer/linuxbrew,skinny-framework/homebrew,joshfriend/homebrew,base10/homebrew,SuperNEMO-DBD/cadfaelbrew,BrewTestBot/homebrew,AlexejK/homebrew,dickeyxxx/homebrew,Linuxbrew/linuxbrew,LinusU/homebrew,youtux/homebrew,Asuranceturix/homebrew,lrascao/homebrew,theeternalsw0rd/homebrew,muellermartin/homebrew,royhodgman/homebrew,galaxy001/homebrew,ExtremeMan/homebrew,dplarson/homebrew,dutchcoders/homebrew,Linuxbrew/linuxbrew,jamer/homebrew,muellermartin/homebrew,totalvoidness/homebrew,Asuranceturix/homebrew,skinny-framework/homebrew,ablyler/homebrew,pcottle/homebrew,Homebrew/homebrew,Homebrew/linuxbrew,apjanke/homebrew,tutumcloud/homebrew,getgauge/homebrew,reelsense/homebrew,michaKFromParis/homebrew-sparks,marcwebbie/homebrew,quantumsteve/homebrew,scorphus/homebrew,esamson/homebrew,quantumsteve/homebrew,ilovezfs/homebrew,thinker0/homebrew,treyharris/homebrew,dongcarl/homebrew,skinny-framework/homebrew,alebcay/homebrew,dericed/homebrew,elyscape/homebrew,saketkc/linuxbrew,royhodgman/homebrew,booi/homebrew,elgertam/homebrew,Red54/homebrew,ilovezfs/homebrew,youtux/homebrew,dickeyxxx/homebrew,influxdata/homebrew,brunchboy/homebrew,josa42/homebrew,LinusU/homebrew,scpeters/homebrew,AlexejK/homebrew,kevinastone/homebrew,dongcarl/homebrew,Linuxbrew/linuxbrew,sakra/homebrew,brunchboy/homebrew,afh/homebrew,pcottle/homebrew,hanxue/homebrew,drewwells/homebrew,brunchboy/homebrew,lrascao/homebrew,scorphus/homebrew,reelsense/linuxbrew,afh/homebrew,Angeldude/linuxbrew,Angeldude/linuxbrew,drewwells/homebrew,liamstask/homebrew,esamson/homebrew,gnubila-france/linuxbrew,scorphus/homebrew,emcrisostomo/homebrew,ablyler/homebrew,thinker0/homebrew,influxdata/homebrew,liamstask/homebrew,sferik/homebrew,sometimesfood/homebrew,yumitsu/homebrew,benjaminfrank/homebrew,reelsense/homebrew,ExtremeMan/homebrew,treyharris/homebrew,frodeaa/homebrew,deorth/homebrew,alebcay/homebrew,slyphon/homebrew,youtux/homebrew,Angeldude/linuxbrew,saketkc/linuxbrew,BrewTestBot/homebrew,bigbes/homebrew,drbenmorgan/linuxbrew,filcab/homebrew,hakamadare/homebrew,nandub/homebrew,marcwebbie/homebrew,afh/homebrew,jamer/homebrew,pcottle/homebrew,chadcatlett/homebrew,SteveClement/homebrew,optikfluffel/homebrew,cprecioso/homebrew,vigo/homebrew,booi/homebrew,filcab/homebrew,elgertam/homebrew,filcab/homebrew,dericed/homebrew,cscetbon/homebrew,apjanke/homebrew,esamson/homebrew,LinusU/homebrew,drbenmorgan/linuxbrew,influxdb/homebrew,LinusU/homebrew,reelsense/linuxbrew,galaxy001/homebrew,alebcay/homebrew,elgertam/homebrew,dplarson/homebrew,ablyler/homebrew,royhodgman/homebrew,Homebrew/homebrew,cprecioso/homebrew,sakra/homebrew,alebcay/homebrew,3van/homebrew,influxdb/homebrew,Asuranceturix/homebrew,elyscape/homebrew,nandub/homebrew,jamer/homebrew,sjackman/linuxbrew,hanxue/homebrew,ryanfb/homebrew,treyharris/homebrew,galaxy001/homebrew,sakra/homebrew,mkrapp/homebrew,nandub/homebrew,ear/homebrew,ryanfb/homebrew,josa42/homebrew,pcottle/homebrew,sferik/homebrew,hakamadare/homebrew,getgauge/homebrew,slyphon/homebrew,totalvoidness/homebrew,elyscape/homebrew,jamer/homebrew,slyphon/homebrew,Homebrew/linuxbrew,Homebrew/homebrew,ralic/homebrew,SteveClement/homebrew,sferik/homebrew,Asuranceturix/homebrew,kevinastone/homebrew,dplarson/homebrew,deorth/homebrew,apjanke/homebrew,base10/homebrew,Homebrew/linuxbrew,drbenmorgan/linuxbrew,ear/homebrew,Angeldude/linuxbrew,theeternalsw0rd/homebrew,muellermartin/homebrew,sometimesfood/homebrew,cprecioso/homebrew,cscetbon/homebrew,bigbes/homebrew,Red54/homebrew,yumitsu/homebrew,chadcatlett/homebrew,gawbul/homebrew,mkrapp/homebrew,tutumcloud/homebrew,decors/homebrew,totalvoidness/homebrew,SuperNEMO-DBD/cadfaelbrew,DoomHammer/linuxbrew,tschoonj/homebrew,DoomHammer/linuxbrew,vigo/homebrew,scpeters/homebrew,vigo/homebrew,benjaminfrank/homebrew,frodeaa/homebrew,sometimesfood/homebrew,frodeaa/homebrew,hakamadare/homebrew,dericed/homebrew,bigbes/homebrew,treyharris/homebrew,reelsense/linuxbrew,benjaminfrank/homebrew,reelsense/linuxbrew,nandub/homebrew,Red54/homebrew,ilovezfs/homebrew,galaxy001/homebrew,scpeters/homebrew,liamstask/homebrew,3van/homebrew,filcab/homebrew,influxdata/homebrew,frodeaa/homebrew,dickeyxxx/homebrew,reelsense/homebrew,chadcatlett/homebrew,sometimesfood/homebrew,influxdb/homebrew,DoomHammer/linuxbrew,BrewTestBot/homebrew,georgschoelly/homebrew,tutumcloud/homebrew,tschoonj/homebrew,SteveClement/homebrew,influxdata/homebrew,saketkc/linuxbrew,emcrisostomo/homebrew,thinker0/homebrew,elgertam/homebrew,hakamadare/homebrew,deorth/homebrew,ablyler/homebrew,ralic/homebrew,dericed/homebrew,3van/homebrew,ear/homebrew,benjaminfrank/homebrew,saketkc/linuxbrew,AlexejK/homebrew,georgschoelly/homebrew,SuperNEMO-DBD/cadfaelbrew,gawbul/homebrew,ear/homebrew,ryanfb/homebrew,kevinastone/homebrew,bigbes/homebrew,michaKFromParis/homebrew-sparks,marcwebbie/homebrew,sakra/homebrew,georgschoelly/homebrew,base10/homebrew,OJFord/homebrew,michaKFromParis/homebrew-sparks,ralic/homebrew,drewwells/homebrew,brunchboy/homebrew,optikfluffel/homebrew,joshfriend/homebrew,dutchcoders/homebrew,apjanke/homebrew,josa42/homebrew,dongcarl/homebrew,gnubila-france/linuxbrew,thinker0/homebrew,theeternalsw0rd/homebrew,base10/homebrew,SteveClement/homebrew,tschoonj/homebrew,dongcarl/homebrew,emcrisostomo/homebrew,pcottle/homebrew,vigo/homebrew,dutchcoders/homebrew,getgauge/homebrew,OJFord/homebrew,sferik/homebrew,sjackman/linuxbrew,reelsense/homebrew,OJFord/homebrew,Red54/homebrew,georgschoelly/homebrew,drbenmorgan/linuxbrew,tutumcloud/homebrew,decors/homebrew,totalvoidness/homebrew,mkrapp/homebrew,ilovezfs/homebrew,dutchcoders/homebrew,sjackman/linuxbrew,Homebrew/linuxbrew,afh/homebrew,royhodgman/homebrew,ExtremeMan/homebrew,ryanfb/homebrew,emcrisostomo/homebrew,ralic/homebrew,Homebrew/homebrew,Linuxbrew/linuxbrew,quantumsteve/homebrew,sjackman/linuxbrew,decors/homebrew,SteveClement/homebrew,scpeters/homebrew,slyphon/homebrew,youtux/homebrew,muellermartin/homebrew,scorphus/homebrew,cprecioso/homebrew,tschoonj/homebrew,marcwebbie/homebrew,OJFord/homebrew,quantumsteve/homebrew,decors/homebrew,gnubila-france/linuxbrew,hanxue/homebrew,drewwells/homebrew,theeternalsw0rd/homebrew,influxdb/homebrew,Asuranceturix/homebrew,dickeyxxx/homebrew,gnubila-france/linuxbrew,joshfriend/homebrew,elyscape/homebrew,dplarson/homebrew,3van/homebrew,yumitsu/homebrew,gawbul/homebrew,lrascao/homebrew,SuperNEMO-DBD/cadfaelbrew