示例#1
0
        public Diff ParseRevisionDiff(GitOutput output)
        {
            Assert.IsNotNull(output);

            output.ThrowOnBadReturnCode();
            var parser = new DiffParser(output.Output);
            return parser.ReadDiff(DiffType.CommittedChanges);
        }
示例#2
0
        public Diff ParseDiff(QueryDiffParameters parameters, GitOutput output)
        {
            Assert.IsNotNull(parameters);
            Assert.IsNotNull(output);

            if(output.ExitCode != 0)
            {
                if(parameters.Cached && IsNoHEADCommitToCompareWithError(output.Error))
                {
                    throw new RepositoryIsEmptyException(output.Error);
                }
                output.Throw();
            }
            var parser = new DiffParser(output.Output);
            var diffType = GetDiffType(parameters);
            return parser.ReadDiff(diffType);
        }