Refactoring to get Git Version
This commit is contained in:
@@ -46,7 +46,7 @@ namespace Sep.Git.Tfs.Commands
|
||||
stdout.WriteLine();
|
||||
|
||||
// show git version
|
||||
globals.Repository.CommandOutputPipe(reader => stdout.Write(reader.ReadToEnd()), "--version");
|
||||
stdout.WriteLine(globals.GitVersion);
|
||||
}
|
||||
|
||||
private void DescribeGitTfs()
|
||||
|
||||
@@ -80,6 +80,19 @@ namespace Sep.Git.Tfs
|
||||
|
||||
public int GcCountdown { get; set; }
|
||||
|
||||
private string _gitVersion;
|
||||
public string GitVersion
|
||||
{
|
||||
get
|
||||
{
|
||||
if (_gitVersion != null)
|
||||
return _gitVersion;
|
||||
if (Repository == null)
|
||||
return null;
|
||||
return _gitVersion = Repository.CommandOneline("--version");
|
||||
}
|
||||
}
|
||||
|
||||
public int GcPeriod
|
||||
{
|
||||
get { return 200; }
|
||||
|
||||
Reference in New Issue
Block a user