public CSharpMethod(string fullmethodname, CSharpMethodBodyStatistics bodyStatistics, string file, Commit commit) { _fullmethodname = fullmethodname; _bodyStatistics = bodyStatistics; _file = file; _commit = commit; }
public void CheckoutCommit(string workingCopyPath, Commit commit) { if (workingCopyPath == null) throw new ArgumentNullException("workingCopyPath"); var workingCopyDirectory = new DirectoryInfo(workingCopyPath); if (!workingCopyDirectory.GetDirectories(".git").Any()) { throw new ArgumentException("The working copy path does not seem to contain a .git folder.", "workingCopyPath"); } var startInfo = new ProcessStartInfo( _gitPath, string.Format("checkout --force {0}", commit.Hash)) { RedirectStandardOutput = true, WindowStyle = ProcessWindowStyle.Hidden, UseShellExecute = false, WorkingDirectory = workingCopyPath }; using (var process = Process.Start(startInfo)) { process.WaitForExit(); } }
public static IEnumerable<CSharpFile> Enumerate(string workingCopyPath, Commit commit) { return Directory.EnumerateFiles(workingCopyPath, "*.cs", SearchOption.AllDirectories).Select(file => new CSharpFile(file, commit)); }
public CSharpFile(string file, Commit commit) { _file = file; _commit = commit; }