//[Test, Ignore("")]
        public void Test()
        {
            var cli     = new GitCommandLine(Constants.NUnitDirectory);
            var fullLog = cli.Log();

            File.WriteAllText("d:\\full.txt", fullLog);
            var logNoRenames = cli.LogWithoutRenames();

            File.WriteAllText("d:\\simple.txt", logNoRenames);
        }
Beispiel #2
0
        public GitDebugHelper(string directory, GitCommandLine cmd)
        {
            _gitCli = cmd;

            _debugLogFile           = File.CreateText(Path.Combine(directory, "debug.txt"));
            _debugLogFile.AutoFlush = true;
            _directory = directory;

            if (!Directory.Exists(directory))
            {
                Directory.CreateDirectory(directory);
            }
        }
Beispiel #3
0
        public void FixEncoding2()
        {
            // We have to tell about the process output encoding.
            // Much more reasonable than starting to recode strings

            var expected = "äöü";
            var cmd      = "git log Tests/Resources/file_with_umlauts_äöü.cs";
            var cli      = new GitCommandLine(@"d:\Git Repositories\Insight");
            var result   = cli.Log(@"d:\Git Repositories\Insight\Tests\Resources\file_with_umlauts_äöü.cs");

            Assert.IsTrue(result.Contains(expected));

            var bytes = new Byte[] { 0xc3, 0xa4, 0xc3, 0xb6, 0xc3, 0xbc };
            var str   = Encoding.UTF8.GetString(bytes);

            Assert.AreEqual(expected, str);
        }
Beispiel #4
0
        public void FixEncoding2()
        {
            // We have to tell about the process output encoding.
            // Much more reasonable than starting to recode strings

            var assembly  = Assembly.GetAssembly(GetType());
            var directory = new FileInfo(assembly.Location).Directory.FullName;
            var resources = Path.Combine(directory, @"..\Tests\Resources");


            const string expected = "äöü";
            var          cli      = new GitCommandLine(Path.Combine(directory, ".."));
            var          result   = cli.Log(Path.Combine(resources, "file_with_umlauts_äöü.cs"));

            Assert.IsTrue(result.Contains(expected));

            var bytes = new byte[] { 0xc3, 0xa4, 0xc3, 0xb6, 0xc3, 0xbc };
            var str   = Encoding.UTF8.GetString(bytes);

            Assert.AreEqual(expected, str);
        }