C# Класс GitHub.Services.GitService

Наследование: IGitService
Показать файл Открыть проект Примеры использования класса

Открытые методы

Метод Описание
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.

Описание методов

GetLatestPushedSha() публичный Метод

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.
Результат Task

GetRemoteUri() публичный Метод

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
Результат UriString

GetRepository() публичный Метод

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
Результат IRepository

GetUri() публичный Метод

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
Результат UriString

GetUri() публичный Метод

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
Результат UriString