Ejemplo n.º 1
0
        public async Task <GitLogOutput[]> Log(string filePath, string baseCommit, string headCommit, Range lines)
        {
            var handler  = new GitLogOutputHandler();
            var gitBlame = new ProcessConfig("git",
                                             $"log --ancestry-path {baseCommit}..{headCommit} -L {lines.Start},{lines.End}:{filePath}", (s, b) =>
            {
                if (!b)
                {
                    handler.ReadLine(s);
                }
                if (b && !string.IsNullOrEmpty(s))
                {
                    Console.WriteLine($"Error git: {s}");
                }
            }, RepositoryPath);
            await ProcessUtils.RunProcess(gitBlame);

            return(handler.GetOutputs());
        }
Ejemplo n.º 2
0
        public async Task <GitLogOutput> Log(string commit)
        {
            var handler  = new GitLogOutputHandler();
            var gitBlame = new ProcessConfig("git",
                                             $"log --date=rfc -1 {commit}", (s, b) =>
            {
                if (!b)
                {
                    handler.ReadLine(s);
                }
                if (b && !string.IsNullOrEmpty(s))
                {
                    Console.WriteLine($"Error git: {s}");
                }
            }, RepositoryPath);
            await ProcessUtils.RunProcess(gitBlame);

            await Task.Delay(250);

            return(handler.GetOutputs().FirstOrDefault());
        }