Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/mono/libgit2sharp.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBen Straub <bs@github.com>2014-01-18 01:26:59 +0400
committerBen Straub <bs@github.com>2014-01-18 01:26:59 +0400
commit0bbed219976caab5e697fb3c158058511157b297 (patch)
tree08f4e08bc51ce1ce46654f9d95d1c9850937bed5
parentcc4bb2da1de35122860993cb1f5c9fae7a724f59 (diff)
Bind git_patch_line_stats
-rw-r--r--LibGit2Sharp/Core/NativeMethods.cs7
-rw-r--r--LibGit2Sharp/Core/Proxy.cs11
2 files changed, 18 insertions, 0 deletions
diff --git a/LibGit2Sharp/Core/NativeMethods.cs b/LibGit2Sharp/Core/NativeMethods.cs
index 9b2f9215..67f0ad9d 100644
--- a/LibGit2Sharp/Core/NativeMethods.cs
+++ b/LibGit2Sharp/Core/NativeMethods.cs
@@ -732,6 +732,13 @@ namespace LibGit2Sharp.Core
internal static extern int git_patch_print(PatchSafeHandle patch, git_diff_line_cb print_cb, IntPtr payload);
[DllImport(libgit2)]
+ internal static extern int git_patch_line_stats(
+ out UIntPtr total_context,
+ out UIntPtr total_additions,
+ out UIntPtr total_deletions,
+ PatchSafeHandle patch);
+
+ [DllImport(libgit2)]
internal static extern void git_patch_free(IntPtr patch);
[DllImport(libgit2)]
diff --git a/LibGit2Sharp/Core/Proxy.cs b/LibGit2Sharp/Core/Proxy.cs
index 01377e04..5f60e793 100644
--- a/LibGit2Sharp/Core/Proxy.cs
+++ b/LibGit2Sharp/Core/Proxy.cs
@@ -1302,6 +1302,17 @@ namespace LibGit2Sharp.Core
}
}
+ public static Tuple<int, int> git_patch_line_stats(PatchSafeHandle patch)
+ {
+ using (ThreadAffinity())
+ {
+ UIntPtr ctx, add, del;
+ int res = NativeMethods.git_patch_line_stats(out ctx, out add, out del, patch);
+ Ensure.ZeroResult(res);
+ return new Tuple<int, int>((int)add, (int)del);
+ }
+ }
+
#endregion
#region git_push_