1
1
mirror of https://github.com/go-gitea/gitea synced 2025-07-22 18:28:37 +00:00

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)