C# Класс Hpdi.Vss2Git.GitWrapper

Wraps execution of Git and implements the common Git commands.
Показать файл Открыть проект Примеры использования класса

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

Метод Описание
Add ( IEnumerable paths ) : bool
Add ( string path ) : bool
AddAll ( ) : bool
Commit ( string authorName, string authorEmail, string comment, DateTime localTime ) : bool
FindExecutable ( ) : bool
GitWrapper ( string repoPath, Logger logger ) : System
Init ( ) : void
Move ( string sourcePath, string destPath ) : void
Remove ( string path, bool recursive ) : void
SetConfig ( string name, string value ) : void
Tag ( string name, string taggerName, string taggerEmail, string comment, DateTime localTime ) : void

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

Метод Описание
AddComment ( string comment, string &args, TempFile &tempFile ) : void
Execute ( ProcessStartInfo startInfo, string &stdout, string &stderr ) : int
ExecuteUnless ( ProcessStartInfo startInfo, string unless ) : bool
FailExitCode ( string exec, string args, string stdout, string stderr, int exitCode ) : void
FindInPathVar ( string filename, string &foundPath ) : bool
FindInPaths ( string filename, IEnumerable searchPaths, string &foundPath ) : bool
GetStartInfo ( string args ) : ProcessStartInfo
GetUtcTimeString ( DateTime localTime ) : string
GitExec ( string args ) : void
GitExecUnless ( string args, string unless ) : bool
NeedsQuoting ( char c ) : bool
Quote ( string arg ) : string

Puts quotes around a command-line argument if it includes whitespace or quotes.

There are two things going on in this method: quoting and escaping. Quoting puts the entire string in quotes, whereas escaping is per- character. Quoting happens only if necessary, when whitespace or a quote is encountered somewhere in the string, and escaping happens only within quoting. Spaces don't need escaping, since that's what the quotes are for. Slashes don't need escaping because apparently a backslash is only interpreted as an escape when it precedes a quote. Otherwise both slash and backslash are just interpreted as directory separators.

memoryStreamToString ( MemoryStream strm ) : string
parseOutput ( StreamReader output, char mark ) : string

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

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

public Add ( IEnumerable paths ) : bool
paths IEnumerable
Результат bool

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

public Add ( string path ) : bool
path string
Результат bool

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

public AddAll ( ) : bool
Результат bool

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

public Commit ( string authorName, string authorEmail, string comment, DateTime localTime ) : bool
authorName string
authorEmail string
comment string
localTime DateTime
Результат bool

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

public FindExecutable ( ) : bool
Результат bool

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

public GitWrapper ( string repoPath, Logger logger ) : System
repoPath string
logger Logger
Результат System

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

public Init ( ) : void
Результат void

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

public Move ( string sourcePath, string destPath ) : void
sourcePath string
destPath string
Результат void

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

public Remove ( string path, bool recursive ) : void
path string
recursive bool
Результат void

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

public SetConfig ( string name, string value ) : void
name string
value string
Результат void

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

public Tag ( string name, string taggerName, string taggerEmail, string comment, DateTime localTime ) : void
name string
taggerName string
taggerEmail string
comment string
localTime DateTime
Результат void