Class RemoteRepoApi
Implements easy-to-use remote GitHub repository related APIs.
Namespace: Neon.GitHub
Assembly: Neon.GitHub.dll
Syntax
public class RemoteRepoApi
Properties
BaseUri
Returns the base URI for the repository on GitHub.
note
This includes the trailing slash.
Declaration
public string BaseUri { get; }
Property Value
| Type | Description |
|---|---|
| string |
Branch
Returns the friendly GitHub branch related APIs.
Declaration
public RemoteRepoBranchApi Branch { get; }
Property Value
| Type | Description |
|---|---|
| RemoteRepoBranchApi |
Id
Returns the remote repository's ID.
Declaration
public long Id { get; }
Property Value
| Type | Description |
|---|---|
| long |
Issue
Returns the friendly GitHub issue related APIs.
Declaration
public RemoteRepoIssueApi Issue { get; }
Property Value
| Type | Description |
|---|---|
| RemoteRepoIssueApi |
Name
Returns the remote repo name.
Declaration
public string Name { get; }
Property Value
| Type | Description |
|---|---|
| string |
Owner
Returns the remote repo owner.
Declaration
public string Owner { get; }
Property Value
| Type | Description |
|---|---|
| string |
Path
Returns the GitHub repository path.
Declaration
public RemoteRepoPath Path { get; }
Property Value
| Type | Description |
|---|---|
| RemoteRepoPath |
Release
Returns the friendly GitHub release related APIs.
Declaration
public RemoteRepoReleaseApi Release { get; }
Property Value
| Type | Description |
|---|---|
| RemoteRepoReleaseApi |
Tag
Returns the friendly GitHub release related APIs.
Declaration
public RemoteRepoTagApi Tag { get; }
Property Value
| Type | Description |
|---|---|
| RemoteRepoTagApi |
UploadTimeout
Specifies the maximum time to wait while uploading files to GitHub, such as GitHub release assets. This defaults to 10 minutes.
note
This doesn't work right now due to an Octokit bug. We work around this by initializing the underlying HttpClient timeout to 10 minutes.
Declaration
public TimeSpan UploadTimeout { get; set; }
Property Value
| Type | Description |
|---|---|
| TimeSpan |
Methods
CreateComitter()
Creates a LibGit2Sharp.Signature from the repository's credentials.
Declaration
public Committer CreateComitter()
Returns
| Type | Description |
|---|---|
| Committer | The new Octokit.Committer. |
Exceptions
| Type | Condition |
|---|---|
| ObjectDisposedException | Thrown when the instance is disposed. |
GetApiUri(string)
Returns a URI for the GitHub API server by combining the GitHub API endpoint with the relative path passed.
Declaration
public string GetApiUri(string path)
Parameters
| Type | Name | Description |
|---|---|---|
| string | path | Specifies the relative path. This may or may not include a leading forward slash (/). |
Returns
| Type | Description |
|---|---|
| string | The API URI. |
GetAsync()
Returns the current Octokit.Repository for the orgin repository assocated with the parent GitHubRepo instance.
Declaration
public Task<Repository> GetAsync()
Returns
| Type | Description |
|---|---|
| Task<Repository> | The associated Octokit.Repository. |
GetCommitsAsync(string, DateTimeOffset?, DateTimeOffset?)
Returns the commits for a named branch in decending order by date/time..
Declaration
public Task<IEnumerable<GitHubCommit>> GetCommitsAsync(string branch, DateTimeOffset? since = null, DateTimeOffset? until = null)
Parameters
| Type | Name | Description |
|---|---|---|
| string | branch | Specifies the branch name. |
| DateTimeOffset? | since | Optionally specifies that only commits before the date/time are to be returned. |
| DateTimeOffset? | until | Optionally specifies that only commits after the date/time are to be returned. |
Returns
| Type | Description |
|---|---|
| Task<IEnumerable<GitHubCommit>> | The commits in decending order by date/time. |
MergeUpstreamAsync(string)
Merges changes to the current forked repo from the upstream source repo.
Declaration
public Task MergeUpstreamAsync(string branch)
Parameters
| Type | Name | Description |
|---|---|---|
| string | branch | Identifies the local branch to be merged. |
Returns
| Type | Description |
|---|---|
| Task | The tracking Task. |