Repository Branches Resource¶
Added in 2.0
Provides information on the branches in a repository.
Data on branches will not be available for all types of repositories.
Details¶
Name | branches |
URI | /api/repositories/{repository_id}/branches/ |
Token Policy ID | repository_branches |
HTTP Methods |
|
Parent Resource | |
Child Resources | None |
Fields¶
commitString | The revision identifier of the commit. The format depends on the repository type (it may be a number, SHA-1 hash, or some other type). This should be treated as a relatively opaque value, but can be used as the |
defaultBoolean | If set, this branch is considered the “tip” of the repository. It would represent “master” for Git repositories, “trunk” for Subversion, etc. This will be |
idString | The ID of the branch. This is specific to the type of repository. |
nameString | The name of the branch. |
Links¶
Name |
Method |
Resource |
---|---|---|
self | GET |
HTTP GET¶
Retrieves an array of the branches in a repository.
Errors¶
100 - Does Not ExistHTTP 404 - Not Found | Object does not exist |
101 - Permission DeniedHTTP 403 - Forbidden | You don’t have permission for this |
103 - Not Logged InHTTP 401 - Unauthorized | You are not logged in |
112 - OAuth2 Missing Scope ErrorHTTP 403 - Forbidden | Your OAuth2 token lacks the necessary scopes for this request. |
113 - OAuth2 Access Denied ErrorHTTP 403 - Forbidden | OAuth2 token access for this resource is prohibited. |
209 - Repository Action Not SupportedHTTP 501 - Not Implemented | The specified repository is not able to perform this action. |
210 - Repository Information ErrorHTTP 500 - Internal Server Error | There was an error communicating with this repository. |
216 - Unverified Host CertificateHTTP 403 - Forbidden | The HTTPS certificate on the host is unverified. |
Examples¶
application/vnd.reviewboard.org.repository-branches+json¶
$ curl https://reviews.example.com/api/repositories/1/branches/ -H "Accept: application/json"
HTTP 200 OK
Content-Length: 332
Content-Type: application/vnd.reviewboard.org.repository-branches+json
ETag: 85f22362adf04c3469c9df98f8959360d4241a81
Vary: Accept, Cookie
X-Content-Type-Options: nosniff
{
"branches": [
{
"commit": "2200",
"default": true,
"id": "trunk",
"name": "trunk"
},
{
"commit": "2105",
"default": false,
"id": "branches/reviewboard",
"name": "reviewboard"
},
{
"commit": "2096",
"default": false,
"id": "releases",
"name": "releases"
},
{
"commit": "2201",
"default": false,
"id": "wiki",
"name": "wiki"
}
],
"stat": "ok"
}