DiffFile() 공개 메소드

public DiffFile ( string fileName, string commitId1, string commitId2 ) : string
fileName string
commitId1 string
commitId2 string
리턴 string
예제 #1
0
        public void DiffFileTest()
        {
            GitRepository.Init(tempFolder);
            File.WriteAllLines(tempFilePath, lines);

            GitRepository tracker = new GitRepository(tempFolder);
            tracker.StageFile(tempFile);
            tracker.Commit("test message");
            File.WriteAllText(tempFilePath, "changed text");
            var diffFile = tracker.DiffFile(tempFile);
            var diff = File.ReadAllText(diffFile);
            Assert.IsTrue(diff.Contains("@@ -1,3 +1 @@"));
        }