C# Class Sep.Git.Tfs.Core.GitHelpers

Inheritance: IGitHelpers
Datei anzeigen Open project: pmiossec/git-tfs Class Usage Examples

Public Methods

Method Description
Command ( ) : string

Runs the given git command, and returns the contents of its STDOUT.

CommandInputOutputPipe ( TextReader>.Action interact ) : void
CommandInputPipe ( Action action ) : void
CommandNoisy ( ) : void

Runs the given git command, and passes STDOUT through to the current process's STDOUT.

CommandOneline ( ) : string

Runs the given git command, and returns the first line of its STDOUT.

CommandOutputPipe ( ) : TextReader

Runs the given git command, and returns a reader for STDOUT. NOTE: The returned value MUST be disposed!

CommandOutputPipe ( Action handleOutput ) : void

Runs the given git command, and redirects STDOUT to the provided action.

GitHelpers ( IContainer container ) : System
MakeRepository ( string dir ) : IGitRepository
WrapGitCommandErrors ( string exceptionMessage, System.Action action ) : void

WrapGitCommandErrors the actions, and if there are any git exceptions, rethrow a new exception with the given message.

Protected Methods

Method Description
Start ( string command, Action initialize ) : GitProcess

Private Methods

Method Description
AssertValidCommand ( string command ) : void
Close ( GitProcess process ) : void
RedirectStderr ( ProcessStartInfo startInfo ) : void
RedirectStdin ( ProcessStartInfo startInfo ) : void
RedirectStdout ( ProcessStartInfo startInfo ) : void
Start ( string command ) : GitProcess
Time ( string command, System.Action action ) : void

Method Details

Command() public method

Runs the given git command, and returns the contents of its STDOUT.
public Command ( ) : string
return string

CommandInputOutputPipe() public method

public CommandInputOutputPipe ( TextReader>.Action interact ) : void
interact TextReader>.Action
return void

CommandInputPipe() public method

public CommandInputPipe ( Action action ) : void
action Action
return void

CommandNoisy() public method

Runs the given git command, and passes STDOUT through to the current process's STDOUT.
public CommandNoisy ( ) : void
return void

CommandOneline() public method

Runs the given git command, and returns the first line of its STDOUT.
public CommandOneline ( ) : string
return string

CommandOutputPipe() public method

Runs the given git command, and returns a reader for STDOUT. NOTE: The returned value MUST be disposed!
public CommandOutputPipe ( ) : TextReader
return TextReader

CommandOutputPipe() public method

Runs the given git command, and redirects STDOUT to the provided action.
public CommandOutputPipe ( Action handleOutput ) : void
handleOutput Action
return void

GitHelpers() public method

public GitHelpers ( IContainer container ) : System
container IContainer
return System

MakeRepository() public method

public MakeRepository ( string dir ) : IGitRepository
dir string
return IGitRepository

Start() protected method

protected Start ( string command, Action initialize ) : GitProcess
command string
initialize Action
return GitProcess

WrapGitCommandErrors() public method

WrapGitCommandErrors the actions, and if there are any git exceptions, rethrow a new exception with the given message.
public WrapGitCommandErrors ( string exceptionMessage, System.Action action ) : void
exceptionMessage string A friendlier message to wrap the GitCommandException with. {0} is replaced with the command line and {1} is replaced with the exit code.
action System.Action
return void