Fix migration panic when Head.User is not exist (#7226)
Fix migration panic when Head.User is not exist (#7226)

* fix migration panic when Head.User is not exist

* fix test

cez81/gitea,typeless/gitea,go-gitea/gitea,cez81/gitea,sapk-fork/gitea,lafriks/gitea,kubatyszko/gitea,typeless/gitea,go-gitea/gitea,typeless/gitea,vCaesar/gitea,sapk-fork/gitea,vdbt/gitea,vdbt/gitea,typeless/gitea,go-gitea/gitea,lafriks/gitea,cez81/gitea,sapk-fork/gitea,lafriks/gitea,vCaesar/gitea,sapk-fork/gitea,kubatyszko/gitea,kubatyszko/gitea