branch: fix leak when checking against HEAD
branch: fix leak when checking against HEAD

We look up a reference in order to figure out if it's the current
branch, which we need to free once we're done with the check.

As a bonus, only perform the check when we're passed the force flag, as
it's a useless check otherwise.

sim0629/libgit2,falqas/libgit2,jeffhostetler/public_libgit2,maxiaoqian/libgit2,kissthink/libgit2,kenprice/libgit2,jflesch/libgit2-mariadb,kissthink/libgit2,mcanthony/libgit2,ardumont/libgit2,yongthecoder/libgit2,jeffhostetler/public_libgit2,whoisj/libgit2,leoyanggit/libgit2,KTXSoftware/libgit2,yosefhackmon/libgit2,nokiddin/libgit2,whoisj/libgit2,JIghtuse/libgit2,mrksrm/Mingijura,ardumont/libgit2,saurabhsuniljain/libgit2,KTXSoftware/libgit2,mcanthony/libgit2,claudelee/libgit2,sygool/libgit2,kissthink/libgit2,raybrad/libit2,magnus98/TEST,MrHacky/libgit2,chiayolin/libgit2,t0xicCode/libgit2,mcanthony/libgit2,sygool/libgit2,mingyaaaa/libgit2,stewid/libgit2,dleehr/libgit2,chiayolin/libgit2,amyvmiwei/libgit2,mrksrm/Mingijura,joshtriplett/libgit2,sygool/libgit2,JIghtuse/libgit2,mingyaaaa/libgit2,spraints/libgit2,ardumont/libgit2,since2014/libgit2,leoyanggit/libgit2,jeffhostetler/public_libgit2,MrHacky/libgit2,sygool/libgit2,kenprice/libgit2,skabel/manguse,MrHacky/libgit2,kenprice/libgit2,stewid/libgit2,MrHacky/libgit2,chiayolin/libgit2,chiayolin/libgit2,JIghtuse/libgit2,ardumont/libgit2,whoisj/libgit2,magnus98/TEST,since2014/libgit2,MrHacky/libgit2,mingyaaaa/libgit2,mhp/libgit2,kenprice/libgit2,nokiddin/libgit2,dleehr/libgit2,Corillian/libgit2,linquize/libgit2,mhp/libgit2,swisspol/DEMO-libgit2,rcorre/libgit2,Corillian/libgit2,nokiddin/libgit2,swisspol/DEMO-libgit2,claudelee/libgit2,leoyanggit/libgit2,falqas/libgit2,skabel/manguse,KTXSoftware/libgit2,amyvmiwei/libgit2,sim0629/libgit2,saurabhsuniljain/libgit2,Snazz2001/libgit2,magnus98/TEST,raybrad/libit2,amyvmiwei/libgit2,maxiaoqian/libgit2,saurabhsuniljain/libgit2,Corillian/libgit2,skabel/manguse,stewid/libgit2,MrHacky/libgit2,JIghtuse/libgit2,leoyanggit/libgit2,dleehr/libgit2,dleehr/libgit2,jflesch/libgit2-mariadb,Tousiph/Demo1,skabel/manguse,Snazz2001/libgit2,stewid/libgit2,mcanthony/libgit2,yongthecoder/libgit2,swisspol/DEMO-libgit2,rcorre/libgit2,joshtriplett/libgit2,Tousiph/Demo1,ardumont/libgit2,yongthecoder/libgit2,spraints/libgit2,spraints/libgit2,JIghtuse/libgit2,jflesch/libgit2-mariadb,falqas/libgit2,spraints/libgit2,nokiddin/libgit2,KTXSoftware/libgit2,claudelee/libgit2,mcanthony/libgit2,spraints/libgit2,sygool/libgit2,mrksrm/Mingijura,Tousiph/Demo1,claudelee/libgit2,linquize/libgit2,kenprice/libgit2,JIghtuse/libgit2,rcorre/libgit2,t0xicCode/libgit2,Corillian/libgit2,yosefhackmon/libgit2,rcorre/libgit2,yongthecoder/libgit2,dleehr/libgit2,yosefhackmon/libgit2,mrksrm/Mingijura,yongthecoder/libgit2,yosefhackmon/libgit2,claudelee/libgit2,yosefhackmon/libgit2,mhp/libgit2,sygool/libgit2,joshtriplett/libgit2,t0xicCode/libgit2,iankronquist/libgit2,oaastest/libgit2,kissthink/libgit2,kissthink/libgit2,linquize/libgit2,mrksrm/Mingijura,iankronquist/libgit2,saurabhsuniljain/libgit2,jeffhostetler/public_libgit2,iankronquist/libgit2,leoyanggit/libgit2,skabel/manguse,mhp/libgit2,rcorre/libgit2,chiayolin/libgit2,skabel/manguse,nokiddin/libgit2,joshtriplett/libgit2,t0xicCode/libgit2,yosefhackmon/libgit2,whoisj/libgit2,swisspol/DEMO-libgit2,magnus98/TEST,maxiaoqian/libgit2,t0xicCode/libgit2,leoyanggit/libgit2,nokiddin/libgit2,whoisj/libgit2,mhp/libgit2,oaastest/libgit2,jflesch/libgit2-mariadb,linquize/libgit2,stewid/libgit2,Snazz2001/libgit2,Tousiph/Demo1,since2014/libgit2,spraints/libgit2,whoisj/libgit2,amyvmiwei/libgit2,Tousiph/Demo1,saurabhsuniljain/libgit2,stewid/libgit2,mingyaaaa/libgit2,oaastest/libgit2,jeffhostetler/public_libgit2,raybrad/libit2,sim0629/libgit2,Corillian/libgit2,falqas/libgit2,mhp/libgit2,claudelee/libgit2,mrksrm/Mingijura,jflesch/libgit2-mariadb,Snazz2001/libgit2,joshtriplett/libgit2,ardumont/libgit2,amyvmiwei/libgit2,saurabhsuniljain/libgit2,falqas/libgit2,mingyaaaa/libgit2,oaastest/libgit2,oaastest/libgit2,since2014/libgit2,raybrad/libit2,t0xicCode/libgit2,sim0629/libgit2,Snazz2001/libgit2,magnus98/TEST,iankronquist/libgit2,oaastest/libgit2,kissthink/libgit2,kenprice/libgit2,sim0629/libgit2,Corillian/libgit2,swisspol/DEMO-libgit2,maxiaoqian/libgit2,amyvmiwei/libgit2,linquize/libgit2,sim0629/libgit2,mcanthony/libgit2,since2014/libgit2,raybrad/libit2,falqas/libgit2,joshtriplett/libgit2,rcorre/libgit2,Snazz2001/libgit2,mingyaaaa/libgit2,chiayolin/libgit2,iankronquist/libgit2,dleehr/libgit2,linquize/libgit2,maxiaoqian/libgit2,jeffhostetler/public_libgit2,magnus98/TEST,KTXSoftware/libgit2,maxiaoqian/libgit2,swisspol/DEMO-libgit2,yongthecoder/libgit2,iankronquist/libgit2,jflesch/libgit2-mariadb,KTXSoftware/libgit2,Tousiph/Demo1,since2014/libgit2