Skip to content

Commit 4399890

Browse files
committed
Remove unused api endpoint
1 parent 9af88ec commit 4399890

File tree

2 files changed

+0
-60
lines changed

2 files changed

+0
-60
lines changed

routers/api/v1/api.go

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1091,7 +1091,6 @@ func Routes() *web.Route {
10911091
}, reqRepoReader(unit.TypeCode))
10921092
m.Group("/commits", func() {
10931093
m.Get("", context.ReferencesGitRepo(), repo.GetAllCommits)
1094-
m.Get("/stats", context.ReferencesGitRepo(), repo.GetAllCommitsStats)
10951094
m.Group("/{ref}", func() {
10961095
m.Get("/status", repo.GetCombinedCommitStatusByRef)
10971096
m.Get("/statuses", repo.GetCommitStatusesByRef)

routers/api/v1/repo/commits.go

Lines changed: 0 additions & 59 deletions
Original file line numberDiff line numberDiff line change
@@ -279,65 +279,6 @@ func GetAllCommits(ctx *context.APIContext) {
279279
ctx.JSON(http.StatusOK, &apiCommits)
280280
}
281281

282-
// GetAllCommitsStats get all commits via
283-
func GetAllCommitsStats(ctx *context.APIContext) {
284-
// swagger:operation GET /repos/{owner}/{repo}/commits/stats repository repoGetAllCommitsStats
285-
// ---
286-
// summary: Get a list of all commits stats from a repository
287-
// produces:
288-
// - application/json
289-
// parameters:
290-
// - name: owner
291-
// in: path
292-
// description: owner of the repo
293-
// type: string
294-
// required: true
295-
// - name: repo
296-
// in: path
297-
// description: name of the repo
298-
// type: string
299-
// required: true
300-
// - name: sha
301-
// in: query
302-
// description: SHA or branch to start listing commits from (usually 'master')
303-
// type: string
304-
// responses:
305-
// "200":
306-
// "$ref": "#/responses/CommitList"
307-
// "404":
308-
// "$ref": "#/responses/notFound"
309-
// "409":
310-
// "$ref": "#/responses/EmptyRepository"
311-
312-
if ctx.Repo.Repository.IsEmpty {
313-
ctx.JSON(http.StatusConflict, api.APIError{
314-
Message: "Git Repository is empty.",
315-
URL: setting.API.SwaggerURL,
316-
})
317-
return
318-
}
319-
320-
sha := ctx.FormString("sha")
321-
322-
var (
323-
commits []*api.ExtendedCommitStats
324-
err error
325-
)
326-
327-
if len(sha) == 0 {
328-
sha = ctx.Repo.Repository.DefaultBranch
329-
}
330-
331-
commits, err = ctx.Repo.GitRepo.ExtendedCommitStats(sha)
332-
333-
if err != nil {
334-
ctx.Error(http.StatusInternalServerError, "ContributorsCommitStats", err)
335-
return
336-
}
337-
338-
ctx.JSON(http.StatusOK, &commits)
339-
}
340-
341282
// DownloadCommitDiffOrPatch render a commit's raw diff or patch
342283
func DownloadCommitDiffOrPatch(ctx *context.APIContext) {
343284
// swagger:operation GET /repos/{owner}/{repo}/git/commits/{sha}.{diffType} repository repoDownloadCommitDiffOrPatch

0 commit comments

Comments
 (0)