C# Класс LibGit2Sharp.Repository

A Repository is the primary interface into a git repository
Наследование: IDisposable
Показать файл Открыть проект Примеры использования класса

Private Properties

Свойство Тип Описание
IsReferencePeelable bool

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

Метод Описание
Discover ( string startingPath ) : string

Probe for a git repository.

The lookup start from startingPath and walk upward parent directories if nothing has been found.

Dispose ( ) : void

Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources.

HasObject ( string sha ) : bool

Tells if the specified sha exists in the repository. Exceptions: ArgumentException ArgumentNullException

Init ( string path, bool isBare = false ) : string

Init a repo at the specified path.

Lookup ( ObjectId id, GitObjectType type = GitObjectType.Any ) : GitObject

Try to lookup an object by its ObjectId and GitObjectType. If no matching object is found, null will be returned.

Lookup ( string shaOrReferenceName, GitObjectType type = GitObjectType.Any ) : GitObject

Try to lookup an object by its sha or a reference canonical name and GitObjectType. If no matching object is found, null will be returned.

Repository ( string path ) : System

Initializes a new instance of the Repository class.

For a standard repository, path should point to the ".git" folder. For a bare repository, path should directly point to the repository folder.

Защищенные методы

Метод Описание
Dispose ( bool disposing ) : void

Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources.

Приватные методы

Метод Описание
IsReferencePeelable ( System.Reference reference ) : bool

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

Discover() публичный статический Метод

Probe for a git repository.

The lookup start from startingPath and walk upward parent directories if nothing has been found.

public static Discover ( string startingPath ) : string
startingPath string The base path where the lookup starts.
Результат string

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

Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources.
public Dispose ( ) : void
Результат void

Dispose() защищенный Метод

Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources.
protected Dispose ( bool disposing ) : void
disposing bool
Результат void

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

Tells if the specified sha exists in the repository. Exceptions: ArgumentException ArgumentNullException
public HasObject ( string sha ) : bool
sha string The sha.
Результат bool

Init() публичный статический Метод

Init a repo at the specified path.
public static Init ( string path, bool isBare = false ) : string
path string The path to the working folder when initializing a standard ".git" repository. Otherwise, when initializing a bare repository, the path to the expected location of this later.
isBare bool true to initialize a bare repository. False otherwise, to initialize a standard ".git" repository.
Результат string

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

Try to lookup an object by its ObjectId and GitObjectType. If no matching object is found, null will be returned.
public Lookup ( ObjectId id, GitObjectType type = GitObjectType.Any ) : GitObject
id ObjectId The id to lookup.
type GitObjectType The kind of GitObject being looked up
Результат GitObject

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

Try to lookup an object by its sha or a reference canonical name and GitObjectType. If no matching object is found, null will be returned.
public Lookup ( string shaOrReferenceName, GitObjectType type = GitObjectType.Any ) : GitObject
shaOrReferenceName string The sha or reference canonical name to lookup.
type GitObjectType The kind of being looked up
Результат GitObject

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

Initializes a new instance of the Repository class.

For a standard repository, path should point to the ".git" folder. For a bare repository, path should directly point to the repository folder.

public Repository ( string path ) : System
path string The path to the git repository to open.
Результат System