Initial cut of git fork

This commit is contained in:
evolvedlight 2014-10-04 18:19:14 +01:00
parent 405ee14711
commit c9e5e38fcf
5 changed files with 139 additions and 4 deletions

View file

@ -217,6 +217,15 @@ func Action(ctx *middleware.Context) {
err = models.StarRepo(ctx.User.Id, ctx.Repo.Repository.Id, true)
case "unstar":
err = models.StarRepo(ctx.User.Id, ctx.Repo.Repository.Id, false)
case "fork":
repo, error := models.ForkRepository(ctx.User, ctx.Repo.Repository)
log.Info("Tried to fork a repo!")
log.Info("Repo thing is " + repo.Name)
if error != nil {
ctx.Redirect(setting.AppSubUrl + "/" + ctx.User.Name + "/" + repo.Name)
return
}
case "desc":
if !ctx.Repo.IsOwner {
ctx.Error(404)