aboutsummaryrefslogtreecommitdiffstats
path: root/routers/api/v1/repo
diff options
context:
space:
mode:
authorUnknwon <u@gogs.io>2015-12-17 22:57:41 -0500
committerUnknwon <u@gogs.io>2015-12-17 22:57:41 -0500
commit1c9dd11ba71ff261f52bf1d31aba6812d0680179 (patch)
tree9862b1736199877f613200450c897ecec6a79f06 /routers/api/v1/repo
parent1e7e092992164acc243ec01859509eaa2207196d (diff)
downloadgitea-1c9dd11ba71ff261f52bf1d31aba6812d0680179.tar.gz
gitea-1c9dd11ba71ff261f52bf1d31aba6812d0680179.zip
#1692 API: admin create repo
Diffstat (limited to 'routers/api/v1/repo')
-rw-r--r--routers/api/v1/repo/repo.go6
1 files changed, 3 insertions, 3 deletions
diff --git a/routers/api/v1/repo/repo.go b/routers/api/v1/repo/repo.go
index 7790377910..eb00aa886f 100644
--- a/routers/api/v1/repo/repo.go
+++ b/routers/api/v1/repo/repo.go
@@ -113,7 +113,7 @@ func ListMyRepos(ctx *middleware.Context) {
ctx.JSON(200, &repos)
}
-func createRepo(ctx *middleware.Context, owner *models.User, opt api.CreateRepoOption) {
+func CreateUserRepo(ctx *middleware.Context, owner *models.User, opt api.CreateRepoOption) {
repo, err := models.CreateRepository(owner, models.CreateRepoOptions{
Name: opt.Name,
Description: opt.Description,
@@ -149,7 +149,7 @@ func Create(ctx *middleware.Context, opt api.CreateRepoOption) {
ctx.APIError(422, "", "not allowed creating repository for organization")
return
}
- createRepo(ctx, ctx.User, opt)
+ CreateUserRepo(ctx, ctx.User, opt)
}
func CreateOrgRepo(ctx *middleware.Context, opt api.CreateRepoOption) {
@@ -167,7 +167,7 @@ func CreateOrgRepo(ctx *middleware.Context, opt api.CreateRepoOption) {
ctx.APIError(403, "", "Given user is not owner of organization.")
return
}
- createRepo(ctx, org, opt)
+ CreateUserRepo(ctx, org, opt)
}
// https://github.com/gogits/go-gogs-client/wiki/Repositories#migrate