public void GetChangedFilesTest1() { var stopwatch = new Stopwatch(); string workingFolder = @"D:\Users\Public\My Projects Tryout\orchard-1.0.20\src"; GitFileStatusTracker target = new GitFileStatusTracker(workingFolder); stopwatch.Start(); var list = target.GetChangedFiles(); stopwatch.Stop(); Debug.WriteLine(list.Count() + ":" + stopwatch.ElapsedMilliseconds); stopwatch.Reset(); stopwatch.Start(); var changes = target.ChangedFiles; stopwatch.Stop(); Debug.WriteLine(changes.Count() + ":" + stopwatch.ElapsedMilliseconds); Assert.AreEqual(list.Count(), changes.Count()); GitBash.GitExePath = @"C:\Program Files (x86)\Git\bin\sh.exe"; stopwatch.Reset(); stopwatch.Start(); GitBash.Run("status --porcelain -z --untracked-files", workingFolder); stopwatch.Stop(); Debug.WriteLine(stopwatch.ElapsedMilliseconds); }
public void GetFileStatusTest1() { var stopwatch = new Stopwatch(); string workingFolder = @"D:\Users\Public\My Projects Tryout\orchard-1.0.20\src"; GitFileStatusTracker target = new GitFileStatusTracker(workingFolder); var list1 = new List<GitFileStatus>(); var list2= new List<GitFileStatus>(); var list = target.GetChangedFiles(); stopwatch.Start(); foreach (var f in list) { list1.Add(target.GetFileStatusNoCache(f.FileName)); } stopwatch.Stop(); Debug.WriteLine(list.Count() + ":" + stopwatch.ElapsedMilliseconds); stopwatch.Reset(); stopwatch.Start(); foreach (var f in list) { list2.Add(target.GetFileStatusNoCacheOld(f.FileName)); } stopwatch.Stop(); Debug.WriteLine(list.Count() + ":" + stopwatch.ElapsedMilliseconds); for(int i=0; i<list1.Count; i++) { Assert.AreEqual(list1[i], list2[i]); } }