public BranchData ParseSingleBranch(QueryBranchParameters parameters, GitOutput output) { Assert.IsNotNull(parameters); Assert.IsNotNull(output); if(output.ExitCode == 0) { var hash = new Hash(output.Output); return new BranchData(parameters.BranchName, hash, false, parameters.IsRemote, false); } else { return null; } }
public Command GetQueryBranchCommand(QueryBranchParameters parameters) { Assert.IsNotNull(parameters); string fullName = (parameters.IsRemote ? GitConstants.RemoteBranchPrefix : GitConstants.LocalBranchPrefix) + parameters.BranchName; return new ShowRefCommand( ShowRefCommand.Verify(), ShowRefCommand.Heads(), ShowRefCommand.Hash(), ShowRefCommand.NoMoreOptions(), new CommandParameter(fullName)); }