private string GitRun(string cmd)
{
if (!this.IsGit) return null;
var result = GitBash.Run(cmd, this.WorkingDirectory);
if (result.HasError) throw new GitException(result.Error);
if (result.Output.StartsWith("fatal:")) throw new GitException(result.Output);
return result.Output;
}