Example #1
0
        private int HunkCallback(IntPtr data, GitDiffDelta delta, GitDiffRange range, IntPtr header, uint headerlen)
        {
            string decodedContent = marshaler.NativeToString(header, headerlen);

            PatchBuilder.AppendFormat("{0}", decodedContent);
            return(0);
        }
Example #2
0
        private int PrintCallBack(IntPtr data, GitDiffDelta delta, GitDiffRange range, GitDiffLineOrigin lineorigin, IntPtr content, uint contentlen)
        {
            string formattedoutput = marshaler.NativeToString(content, contentlen);
            var    currentFilePath = (string)marshaler.MarshalNativeToManaged(delta.NewFile.Path);

            AddLineChange(currentFilePath, lineorigin);

            if (lineorigin == GitDiffLineOrigin.GIT_DIFF_LINE_FILE_HDR)
            {
                AddFileChange(delta);
            }

            changes[currentFilePath].PatchBuilder.Append(formattedoutput);
            fullPatchBuilder.Append(formattedoutput);

            return(0);
        }