Exemplo n.º 1
0
        public static IEnumerable <GitChangeInfo> GetChangedFiles(TextReader reader)
        {
            string line;

            while (null != (line = GetDiffTreeLine(reader)))
            {
                var change = GitChangeInfo.Parse(line);

                if (FileMode.GitLink == change.NewMode)
                {
                    continue;
                }

                yield return(change);
            }
        }
Exemplo n.º 2
0
        public IEnumerable <IGitChangedFile> GetChangedFiles(string from, string to)
        {
            using (var diffOutput = CommandOutputPipe("diff-tree", "-r", "-M", from, to))
            {
                string line;
                while (null != (line = diffOutput.ReadLine()))
                {
                    var change = GitChangeInfo.Parse(line);

                    if (FileMode.GitLink == change.NewMode)
                    {
                        continue;
                    }

                    yield return(BuildGitChangedFile(change));
                }
            }
        }
Exemplo n.º 3
0
 private IGitChangedFile BuildGitChangedFile(GitChangeInfo change)
 {
     return change.ToGitChangedFile(_container.With((IGitRepository) this));
 }
Exemplo n.º 4
0
 private IGitChangedFile BuildGitChangedFile(GitChangeInfo change)
 {
     return(change.ToGitChangedFile(_container.With((IGitRepository)this)));
 }
Exemplo n.º 5
0
 private IGitChangedFile BuildGitChangedFile(GitChangeInfo change)
 {
     var builder = change.Merge(_container.With("repository").EqualTo(this));
     IGitChangedFile changeItem;
     try
     {
         changeItem = builder.GetInstance<IGitChangedFile>(change.Status);
     }
     catch(Exception e)
     {
         throw new Exception("Unable to handle change type " + change.Status + ".", e);
     }
     return changeItem;
 }