private Patch GetFileDifferences(Repository Repo) { Tree head = Repo.Head.Tip.Tree; Tree lastNonlinearCommit = Repo.Head.Commits.ToList().First (a => a.Author.Email.ContainsAny(GitCheck.GetHostDomains())).Tree; return(Repo.Diff.Compare <Patch>(lastNonlinearCommit, head)); }
private void ExecuteTheCheck(string path) { using (var repo = new Repository(path)) { UncommitedFiles = GetUncommitedFiles(repo); if (!GitCheck.LastCommitWasByNonEmployee(repo.Commits) && !UncommitedFiles.Any()) { FileChangeEvidence.SetFailed(new SimpleEvidenceBuilder("Last Commit By Waters Employee")); return; } FillInEvidence(repo); } }