Make compare button URL aware if current repo is a fork (#2162) (#2163)
Make compare button URL aware if current repo is a fork (#2162) (#2163)

* Make compare button URL aware if current repo is a fork (#2162)

* Optimize code

* To not change current behaviour check if signed in user has fork of base repository

* Fix to check only if signed user has forked repo otherwise it will still redirect to wrong page

ethantkoenig/gogs,dl5rcw/gitea,vdbt/gitea,lafriks/gitea,kjellkvinge/gitea,spacetourist/gitea,JonasFranzDEV/gitea,vCaesar/gitea,dnmgns/gitea,andreynering/gitea,typeless/gitea,kubatyszko/gitea,JonasFranzDEV/gitea,kubatyszko/gitea,sapk-fork/gitea,tboerger/gitea,andreynering/gitea,sapk-fork/gitea,sapk-fork/gitea,geek1011/gitea,cumgun/gitea,kjellkvinge/gitea,lafriks/gitea,go-gitea/gitea,jorgesumle/gitea,Bwko/gitea,lunny/gitea,cumgun/gitea,sapk-fork/gitea,cez81/gitea,mjwwit/gitea,typeless/gitea,lunny/gitea,go-gitea/gitea,spacetourist/gitea,Morlinest/gitea,dnmgns/gitea,CaeruleusAqua/gitea,vCaesar/gitea,kjellkvinge/gitea,cez81/gitea,Bwko/gitea,typeless/gitea,Bwko/gitea,lunny/gitea,go-gitea/gitea,cez81/gitea,ethantkoenig/gogs,kubatyszko/gitea,mjwwit/gitea,rems4e/gitea,typeless/gitea,geek1011/gitea,ethantkoenig/gitea,tboerger/gitea,rems4e/gitea,Morlinest/gitea,lafriks/gitea,vdbt/gitea,dnmgns/gitea,ethantkoenig/gitea,tboerger/gitea,jorgesumle/gitea,CaeruleusAqua/gitea