private static List <CommitBlock> GetBlocks(string[] lines) { List <CommitBlock> blocks = new List <CommitBlock>(); int idx = 0; while (idx < lines.Length) { CommitBlock block = new CommitBlock(); while (idx < lines.Length && !String.IsNullOrEmpty(lines[idx])) { if (idx + 1 == lines.Length) { block.LastLine = lines[idx]; } else if (block.Head != null && String.IsNullOrEmpty(lines[idx + 1])) { block.LastLine = lines[idx]; } else if (block.Head == null) { block.Head = lines[idx]; } idx++; } blocks.Add(block); idx++; } return(blocks); }
private static void ReadDevops(CommitBlock block) { string[] headData = block.Head.Split(','); if (_devops.Where(d => d.Name.Equals(headData[1])).SingleOrDefault() == null) { _devops.Add(new Developer() { Name = headData[1] }); } }