routers/repo/release: Use correct branch reference (#3330)
routers/repo/release: Use correct branch reference (#3330)

When calculating the current behind commit count the calculation should
use the current release target to get the total commit count. Should the
release target not exist anymore the calculation will return zero for
the newest release on that target. Older releases on that target will then
use that calculated commit count as reference.

The only use case that is now somehow invalid is when the release target
was merged / deleted after a tag on that release target:

    master 1 - - - - - - - 6
            \             /
    branch   2 - 3 - 4 - 5

When `4` is the last tag on branch `branch` and the branch `branch` is not
yet deleted the calculated numbers would be:

    1 commits to branch since this release

Now if the branch `branch` gets deleted the calculation function will not
find the branch and use the commit count of the newest release (`4`) as
reference resulting in:

    0 commit to branch since this release

This fixes #3326
gogits/gogs,jvanderneutstulen/gogs,psaavedra/gogs,cez81/gitea,lunny/gitea,xaionaro/gogs,vCaesar/gitea,avelino/gitea,typeless/gitea,geek1011/gitea,tszym/gogs,sapk/gogs,cgars/gogs,linquize/gogs,xaionaro/gogs,sapk-fork/gitea,spacetourist/gitea,JonasFranzDEV/gitea,richmahn/gogs,kong36088/SCAUGogits,typeless/gitea,typeless/gitea,DblK/gitea,cgars/gogs,mpindado/gogs,denji/gitea_tmp,vdbt/gitea,cez81/gitea,strk/gogs,Spice-King/gogs,lunny/gitea,lafriks/gitea,mark77z/tt2016,dnmgns/gitea,go-gitea/gitea,strk/gogs,tboerger/gitea,CaeruleusAqua/gitea,manfer/gogs,sapk-fork/gitea,cumgun/gitea,ethantkoenig/gogs,bygreencn/gogs,Morlinest/gitea,dl5rcw/gitea,DblK/gitea,liliexuan/gogs,pikacloud/pikacode,willemvd/gitea,dancewing/gogs,bkcsoft/gogs,ethantkoenig/gitea,tanapoln/gogs,jorgesumle/gitea,mukaiu/gogs,dancewing/gogs,wangjild/gogs,richmahn/gogs,admik/gitea,kong36088/SCAUGogits,sapk/gogs,kong36088/SCAUGogits,sapk-fork/gitea,chriswatt/gogs,odinuge/gogs,bkcsoft/gogs,psolyca/gitea,tszym/gogs,vCaesar/gitea,dancewing/gogs,chriswatt/gogs,spacetourist/gitea,Bwko/gitea,typeless/gitea,jorgesumle/gitea,bygreencn/gogs,wangjild/gogs,cumgun/gitea,ethantkoenig/gogs,denji/gitea_tmp,xaionaro/gogs,denji/gitea,jvanderneutstulen/gogs,dlob/gogs,mpindado/gogs,tboerger/gitea,dnmgns/gitea,psaavedra/gogs,liliexuan/gogs,strk/gogs,dlob/gogs,go-gitea/gitea,pikacloud/pikacode,Bwko/gitea,linquize/gogs,mukaiu/gogs,Morlinest/gitea,andreynering/gitea,ForxaCoLab/forxa,liliexuan/gogs,mpindado/gogs,kjellkvinge/gitea,manfer/gogs,cez81/gitea,dnmgns/gitea,cgars/gogs,dancewing/gogs,vdbt/gitea,Spice-King/gogs,JonasFranzDEV/gitea,sapk-fork/gitea,cybe/gitea,andreynering/gitea,denji/gitea_tmp,puffybsd/gitea,pikacloud/pikacode,mukaiu/gogs,avelino/gitea,tboerger/gitea,Spice-King/gogs,dlob/gogs,go-gitea/gitea,linquize/gogs,ForxaCoLab/forxa,jvanderneutstulen/gogs,mark77z/tt2016,avelino/gitea,cybe/gitea,kubatyszko/gitea,mark77z/tt2016,ForxaCoLab/forxa,psaavedra/gogs,manfer/gogs,bkcsoft/gogs,odinuge/gogs,CaeruleusAqua/gitea,kjellkvinge/gitea,geek1011/gitea,mjwwit/gitea,makhov/gitea,kubatyszko/gitea,avelino/gitea,kjellkvinge/gitea,lafriks/gitea,psolyca/gitea,wangjild/gogs,mjwwit/gitea,chriswatt/gogs,lafriks/gitea,denji/gitea_tmp,bygreencn/gogs,minecrafter/gitea,tanapoln/gogs,Bwko/gitea,ethantkoenig/gitea,gogits/gogs,xormplus/gitea,kubatyszko/gitea,lunny/gitea,gogits/gogs,rems4e/gitea,tszym/gogs,odinuge/gogs,rems4e/gitea,sapk/gogs,tanapoln/gogs