summaryrefslogtreecommitdiffstats
path: root/routers
diff options
context:
space:
mode:
authorevolvedlight <steve@evolvedlight.co.uk>2014-10-10 00:21:36 +0100
committerevolvedlight <steve@evolvedlight.co.uk>2014-10-10 00:21:36 +0100
commit211dc74816c3832f973284f19ad0831da039ac76 (patch)
treef630981dff76f6868dd2ac1badf876a5d648a2a0 /routers
parentc9e5e38fcfa759a1d2578d1c7a56ac0e65e2bf78 (diff)
downloadgitea-211dc74816c3832f973284f19ad0831da039ac76.tar.gz
gitea-211dc74816c3832f973284f19ad0831da039ac76.zip
Got the fork count working
Diffstat (limited to 'routers')
-rw-r--r--routers/repo/repo.go12
1 files changed, 9 insertions, 3 deletions
diff --git a/routers/repo/repo.go b/routers/repo/repo.go
index dac0c48b36..8b18eb25bf 100644
--- a/routers/repo/repo.go
+++ b/routers/repo/repo.go
@@ -219,11 +219,17 @@ func Action(ctx *middleware.Context) {
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 {
+ log.Error(4, "Action(%s): %v", ctx.Params(":action"), error)
+ ctx.JSON(200, map[string]interface{}{
+ "ok": false,
+ "err": error.Error(),
+ })
+ return
+ }
+ if error == nil {
+ ctx.Redirect(setting.AppSubUrl + "/" + repo.Owner.Name + "/" + repo.Name)
- ctx.Redirect(setting.AppSubUrl + "/" + ctx.User.Name + "/" + repo.Name)
return
}
case "desc":