C# Class GitHub.Services.GitService

Inheritance: IGitService
Datei anzeigen Open project: github/VisualStudio Class Usage Examples

Public Methods

Method Description
GetLatestPushedSha ( string path ) : Task

Finds the latest pushed commit of a file and returns the sha of that commit. Returns null when no commits have been found in any remote branches or the current local branch.

GetRemoteUri ( IRepository repo, string remote = "origin" ) : UriString

Returns a UriString representing the uri of a remote

GetRepository ( string path ) : IRepository

Probes for a git repository and if one is found, returns a IRepositoryModel instance for the repository.

The lookup checks to see if the specified path is a repository. If it's not, it then walks up the parent directories until it either finds a repository, or reaches the root disk.

GetUri ( IRepository repository, string remote = "origin" ) : UriString

Returns the URL of the remote for the specified repository. If the repository is null or no remote named origin exists, this method returns null

GetUri ( string path, string remote = "origin" ) : UriString

Probes for a git repository and if one is found, returns a normalized GitHub uri UriString for the repository's remote if one is found

The lookup checks to see if the specified path is a repository. If it's not, it then walks up the parent directories until it either finds a repository, or reaches the root disk.

Method Details

GetLatestPushedSha() public method

Finds the latest pushed commit of a file and returns the sha of that commit. Returns null when no commits have been found in any remote branches or the current local branch.
public GetLatestPushedSha ( string path ) : Task
path string The local path of a repository or a file inside a repository. This cannot be null.
return Task

GetRemoteUri() public method

Returns a UriString representing the uri of a remote
public GetRemoteUri ( IRepository repo, string remote = "origin" ) : UriString
repo IRepository
remote string The name of the remote to look for
return UriString

GetRepository() public method

Probes for a git repository and if one is found, returns a IRepositoryModel instance for the repository.
The lookup checks to see if the specified path is a repository. If it's not, it then walks up the parent directories until it either finds a repository, or reaches the root disk.
public GetRepository ( string path ) : IRepository
path string The path to start probing
return IRepository

GetUri() public method

Returns the URL of the remote for the specified repository. If the repository is null or no remote named origin exists, this method returns null
public GetUri ( IRepository repository, string remote = "origin" ) : UriString
repository IRepository The repository to look at for the remote.
remote string The name of the remote to look for
return UriString

GetUri() public method

Probes for a git repository and if one is found, returns a normalized GitHub uri UriString for the repository's remote if one is found
The lookup checks to see if the specified path is a repository. If it's not, it then walks up the parent directories until it either finds a repository, or reaches the root disk.
public GetUri ( string path, string remote = "origin" ) : UriString
path string The path to start probing
remote string The name of the remote to look for
return UriString