GitSharp.Core.Patch.Patch.ParseGitBinary C# (CSharp) Method

ParseGitBinary() private method

private ParseGitBinary ( FileHeader fh, int c, int end ) : int
fh FileHeader
c int
end int
return int
        private int ParseGitBinary(FileHeader fh, int c, int end)
        {
            var postImage = new BinaryHunk(fh, c);
            int nEnd = postImage.parseHunk(c, end);
            if (nEnd < 0)
            {
                // Not a binary hunk.
                //
                error(fh.Buffer, c, "Missing forward-image in GIT binary patch");
                return c;
            }
            c = nEnd;
            postImage.endOffset = c;
            fh.ForwardBinaryHunk = postImage;

            var preImage = new BinaryHunk(fh, c);
            int oEnd = preImage.parseHunk(c, end);
            if (oEnd >= 0)
            {
                c = oEnd;
                preImage.endOffset = c;
                fh.ReverseBinaryHunk = preImage;
            }

            return c;
        }