File tree Expand file tree Collapse file tree 4 files changed +122
-0
lines changed
vendor/code.gitea.io/sdk/gitea Expand file tree Collapse file tree 4 files changed +122
-0
lines changed Original file line number Diff line number Diff line change @@ -573,6 +573,9 @@ func RegisterRoutes(m *macaron.Macaron) {
573
573
m .Get ("/status" , repo .GetCombinedCommitStatusByRef )
574
574
m .Get ("/statuses" , repo .GetCommitStatusesByRef )
575
575
})
576
+ m .Group ("/git" , func () {
577
+ m .Get ("/refs/*" , repo .GetGitRefs )
578
+ })
576
579
}, repoAssignment ())
577
580
})
578
581
Original file line number Diff line number Diff line change
1
+ // Copyright 2018 Gitea. All rights reserved.
2
+ // Use of this source code is governed by a MIT-style
3
+ // license that can be found in the LICENSE file.
4
+
5
+ package repo
6
+
7
+ import (
8
+ "code.gitea.io/gitea/modules/context"
9
+ )
10
+
11
+ // GetGitRefs get ref or an list all the refs of a repository
12
+ func GetGitRefs (ctx * context.APIContext ) {
13
+ // swagger:operation GET /repos/{owner}/{repo}/git/refs/{ref} repository repoListGitRefs
14
+ // ---
15
+ // summary: Get specified ref or filtered repository's refs
16
+ // produces:
17
+ // - application/json
18
+ // parameters:
19
+ // - name: owner
20
+ // in: path
21
+ // description: owner of the repo
22
+ // type: string
23
+ // required: true
24
+ // - name: repo
25
+ // in: path
26
+ // description: name of the repo
27
+ // type: string
28
+ // required: true
29
+ // - name: ref
30
+ // in: path
31
+ // description: part or full name of the ref
32
+ // type: string
33
+ // required: false
34
+ // responses:
35
+ // "200":
36
+ // "$ref": "#/responses/Ref"
37
+ // "$ref": "#/responses/RefList"
38
+ }
Original file line number Diff line number Diff line change 1560
1560
}
1561
1561
}
1562
1562
},
1563
+ "/repos/{owner}/{repo}/git/refs/{ref}": {
1564
+ "get": {
1565
+ "produces": [
1566
+ "application/json"
1567
+ ],
1568
+ "tags": [
1569
+ "repository"
1570
+ ],
1571
+ "summary": "Get specified ref or filtered repository's refs",
1572
+ "operationId": "repoListGitRefs",
1573
+ "parameters": [
1574
+ {
1575
+ "type": "string",
1576
+ "description": "owner of the repo",
1577
+ "name": "owner",
1578
+ "in": "path",
1579
+ "required": true
1580
+ },
1581
+ {
1582
+ "type": "string",
1583
+ "description": "name of the repo",
1584
+ "name": "repo",
1585
+ "in": "path",
1586
+ "required": true
1587
+ },
1588
+ {
1589
+ "type": "string",
1590
+ "description": "part or full name of the ref",
1591
+ "name": "ref",
1592
+ "in": "path"
1593
+ }
1594
+ ],
1595
+ "responses": {
1596
+ "200": {
1597
+ "$ref": "#/responses/RefList"
1598
+ }
1599
+ }
1600
+ }
1601
+ },
1563
1602
"/repos/{owner}/{repo}/hooks": {
1564
1603
"get": {
1565
1604
"produces": [
You can’t perform that action at this time.
0 commit comments