diff options
author | evolvedlight <steve@evolvedlight.co.uk> | 2014-10-04 18:19:14 +0100 |
---|---|---|
committer | evolvedlight <steve@evolvedlight.co.uk> | 2014-10-04 18:19:14 +0100 |
commit | c9e5e38fcfa759a1d2578d1c7a56ac0e65e2bf78 (patch) | |
tree | 3d31683afb2f11d7108f3ccf0f35950f62dbf6a2 /routers | |
parent | 405ee14711ab946bd709ec28a526890c40cbc03b (diff) | |
download | gitea-c9e5e38fcfa759a1d2578d1c7a56ac0e65e2bf78.tar.gz gitea-c9e5e38fcfa759a1d2578d1c7a56ac0e65e2bf78.zip |
Initial cut of git fork
Diffstat (limited to 'routers')
-rw-r--r-- | routers/repo/repo.go | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/routers/repo/repo.go b/routers/repo/repo.go index 5562a8400a..dac0c48b36 100644 --- a/routers/repo/repo.go +++ b/routers/repo/repo.go @@ -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) |