private static IList <ReflogRecordData> ParseResult1(GitOutput output, Dictionary <Hash, RevisionData> cache) { if (output.Output.Length < 40) { return(new ReflogRecordData[0]); } var parser = new GitParser(output.Output); int index = 0; var list = new List <ReflogRecordData>(); while (!parser.IsAtEndOfString) { var selector = parser.ReadLine(); if (selector.Length == 0) { break; } var message = parser.ReadLine(); var sha1 = parser.ReadHash(skip: 1); RevisionData rev; if (!cache.TryGetValue(sha1, out rev)) { rev = new RevisionData(sha1); cache.Add(sha1, rev); } parser.ParseRevisionData(rev, cache); list.Add(new ReflogRecordData(index++, message, rev)); } return(list); }
private static IList <StashedStateData> ParseResult1(GitOutput output, Dictionary <Hash, RevisionData> cache) { int index = 0; var parser = new GitParser(output.Output); var res = new List <StashedStateData>(); while (!parser.IsAtEndOfString) { var sha1 = new Hash(parser.String, parser.Position); var rev = new RevisionData(sha1); parser.Skip(41); parser.ParseRevisionData(rev, cache); var state = new StashedStateData(index, rev); res.Add(state); ++index; } return(res); }
public RevisionData ParseSingleRevision(QueryRevisionParameters parameters, GitOutput output) { Assert.IsNotNull(parameters); Assert.IsNotNull(output); if(output.ExitCode != 0) { var revName = parameters.SHA1.ToString(); if(IsUnknownRevisionError(output.Error, revName)) { throw new UnknownRevisionException(revName); } output.Throw(); } var parser = new GitParser(output.Output); var rev = new RevisionData(parameters.SHA1); parser.ParseRevisionData(rev, null); return rev; }