private void AddFileChange(GitDiffDelta delta) { var pathPtr = delta.NewFile.Path != IntPtr.Zero ? delta.NewFile.Path : delta.OldFile.Path; var newFilePath = LaxFilePathMarshaler.FromNative(pathPtr); changes.Add(newFilePath, new ContentChanges(delta.IsBinary())); }
private int FileCallback(GitDiffDelta delta, float progress, IntPtr payload) { IsBinaryComparison = delta.IsBinary(); if (!IsBinaryComparison) { return(0); } AppendToPatch("Binary content differ\n"); return(0); }
private void AddFileChange(GitDiffDelta delta) { var treeEntryChanges = new TreeEntryChanges(delta); changes.Add(treeEntryChanges.Path, new PatchEntryChanges(delta.IsBinary(), treeEntryChanges)); }
private TreeEntryChanges AddFileChange(GitDiffDelta delta, GitDiffLineOrigin lineorigin) { var newFilePath = FilePathMarshaler.FromNative(delta.NewFile.Path); if (lineorigin != GitDiffLineOrigin.GIT_DIFF_LINE_FILE_HDR) { return(this[newFilePath]); } var oldFilePath = FilePathMarshaler.FromNative(delta.OldFile.Path); var newMode = (Mode)delta.NewFile.Mode; var oldMode = (Mode)delta.OldFile.Mode; var newOid = delta.NewFile.Oid; var oldOid = delta.OldFile.Oid; if (delta.Status == ChangeKind.Untracked) { delta.Status = ChangeKind.Added; } var diffFile = new TreeEntryChanges(newFilePath, newMode, newOid, delta.Status, oldFilePath, oldMode, oldOid, delta.IsBinary()); fileDispatcher[delta.Status](this, diffFile); changes.Add(newFilePath, diffFile); return(diffFile); }
private void AddFileChange(GitDiffDelta delta) { var newFilePath = FilePathMarshaler.FromNative(delta.NewFile.Path); var oldFilePath = FilePathMarshaler.FromNative(delta.OldFile.Path); var newMode = (Mode)delta.NewFile.Mode; var oldMode = (Mode)delta.OldFile.Mode; var newOid = delta.NewFile.Oid; var oldOid = delta.OldFile.Oid; if (delta.Status == ChangeKind.Untracked || delta.Status == ChangeKind.Ignored) { delta.Status = ChangeKind.Added; } var diffFile = new TreeEntryChanges(newFilePath, newMode, newOid, delta.Status, oldFilePath, oldMode, oldOid, delta.IsBinary()); fileDispatcher[delta.Status](this, diffFile); changes.Add(newFilePath, diffFile); }