internal ContentChanges(Repository repo, Blob oldBlob, Blob newBlob, GitDiffOptions options) { Proxy.git_diff_blobs(repo.Handle, oldBlob != null ? oldBlob.Id : null, newBlob != null ? newBlob.Id : null, options, FileCallback, HunkCallback, LineCallback); }
public static extern int git_diff_blobs( GitObjectSafeHandle oldBlob, GitObjectSafeHandle newBlob, GitDiffOptions options, IntPtr data, git_diff_file_fn fileCallback, git_diff_hunk_fn hunkCallback, git_diff_data_fn lineCallback);
internal static extern int git_diff_blobs( GitObjectSafeHandle oldBlob, GitObjectSafeHandle newBlob, GitDiffOptions options, git_diff_file_cb fileCallback, git_diff_hunk_cb hunkCallback, git_diff_data_cb lineCallback, IntPtr payload);
internal ContentChanges(Repository repo, Blob oldBlob, Blob newBlob, GitDiffOptions options) { using (var osw1 = new ObjectSafeWrapper(oldBlob.Id, repo)) using (var osw2 = new ObjectSafeWrapper(newBlob.Id, repo)) { Ensure.Success(NativeMethods.git_diff_blobs(osw1.ObjectPtr, osw2.ObjectPtr, options, IntPtr.Zero, FileCallback, HunkCallback, LineCallback)); } }
public static extern int git_diff_workdir_to_tree( RepositorySafeHandle repo, GitDiffOptions options, GitObjectSafeHandle oldTree, out DiffListSafeHandle diff);
public static extern int git_diff_workdir_to_index( RepositorySafeHandle repo, GitDiffOptions options, out DiffListSafeHandle diff);
internal static extern int git_diff_index_to_workdir( out DiffListSafeHandle diff, RepositorySafeHandle repo, IndexSafeHandle index, GitDiffOptions options);
internal static extern int git_diff_tree_to_workdir( out DiffListSafeHandle diff, RepositorySafeHandle repo, GitObjectSafeHandle oldTree, GitDiffOptions options);
internal static extern int git_diff_tree_to_index( out DiffListSafeHandle diff, RepositorySafeHandle repo, GitObjectSafeHandle oldTree, IndexSafeHandle index, GitDiffOptions options);
private static GitDiffOptions BuildOptions(DiffModifiers diffOptions, FilePath[] filePaths = null, MatchedPathsAggregator matchedPathsAggregator = null, CompareOptions compareOptions = null) { var options = new GitDiffOptions(); options.Flags |= GitDiffOptionFlags.GIT_DIFF_INCLUDE_TYPECHANGE; compareOptions = compareOptions ?? new CompareOptions(); options.ContextLines = (ushort)compareOptions.ContextLines; options.InterhunkLines = (ushort)compareOptions.InterhunkLines; if (diffOptions.HasFlag(DiffModifiers.IncludeUntracked)) { options.Flags |= GitDiffOptionFlags.GIT_DIFF_INCLUDE_UNTRACKED | GitDiffOptionFlags.GIT_DIFF_RECURSE_UNTRACKED_DIRS | GitDiffOptionFlags.GIT_DIFF_INCLUDE_UNTRACKED_CONTENT; } if (diffOptions.HasFlag(DiffModifiers.IncludeIgnored)) { options.Flags |= GitDiffOptionFlags.GIT_DIFF_INCLUDE_IGNORED; } if (diffOptions.HasFlag(DiffModifiers.IncludeUnmodified)) { options.Flags |= GitDiffOptionFlags.GIT_DIFF_INCLUDE_UNMODIFIED; } if (diffOptions.HasFlag(DiffModifiers.DisablePathspecMatch)) { options.Flags |= GitDiffOptionFlags.GIT_DIFF_DISABLE_PATHSPEC_MATCH; } if (matchedPathsAggregator != null) { options.NotifyCallback = matchedPathsAggregator.OnGitDiffNotify; } if (filePaths == null) { return options; } options.PathSpec = GitStrArrayIn.BuildFrom(filePaths); return options; }
private GitDiffOptions BuildOptions(DiffOptions diffOptions, IEnumerable<string> paths = null) { var options = new GitDiffOptions(); options.Flags |= GitDiffOptionFlags.GIT_DIFF_INCLUDE_TYPECHANGE; options.ContextLines = 3; if (diffOptions.HasFlag(DiffOptions.IncludeUntracked)) { options.Flags |= GitDiffOptionFlags.GIT_DIFF_INCLUDE_UNTRACKED | GitDiffOptionFlags.GIT_DIFF_RECURSE_UNTRACKED_DIRS | GitDiffOptionFlags.GIT_DIFF_INCLUDE_UNTRACKED_CONTENT; } if (paths == null) { return options; } options.PathSpec = GitStrArrayIn.BuildFrom(ToFilePaths(repo, paths)); return options; }
private DiffListSafeHandle BuildDiffListFromTrees(ObjectId oldTree, ObjectId newTree, GitDiffOptions options) { return Proxy.git_diff_tree_to_tree(repo.Handle, oldTree, newTree, options); }
private static DiffListSafeHandle BuildDiffListFromTreeAndComparer(ObjectId treeId, TreeComparisonHandleRetriever comparisonHandleRetriever, GitDiffOptions options) { return BuildDiffListFromComparer(treeId, comparisonHandleRetriever, options); }