8000 Bind git_patch_line_stats · apfunk/libgit2sharp@0bbed21 · GitHub
[go: up one dir, main page]

Skip to content

Commit 0bbed21

Browse files
committed
Bind git_patch_line_stats
1 parent cc4bb2d commit 0bbed21

File tree

2 files changed

+18
-0
lines changed

2 files changed

+18
-0
lines changed

LibGit2Sharp/Core/NativeMethods.cs

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -731,6 +731,13 @@ internal static extern int git_object_peel(
731731
[DllImport(libgit2)]
732732
internal static extern int git_patch_print(PatchSafeHandle patch, git_diff_line_cb print_cb, IntPtr payload);
733733

734+
[DllImport(libgit2)]
735+
internal static extern int git_patch_line_stats(
736+
out UIntPtr total_context,
737+
out UIntPtr total_additions,
738+
out UIntPtr total_deletions,
739+
PatchSafeHandle patch);
740+
734741
[DllImport(libgit2)]
735742
internal static extern void git_patch_free(IntPtr patch);
736743

LibGit2Sharp/Core/Proxy.cs

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1302,6 +1302,17 @@ public static void git_patch_print(PatchSafeHandle patch, NativeMethods.git_diff
13021302
}
13031303
}
13041304

1305+
public static Tuple<int, int> git_patch_line_stats(PatchSafeHandle patch)
1306+
{
1307+
using (ThreadAffinity())
1308+
{
1309+
UIntPtr ctx, add, del;
1310+
int res = NativeMethods.git_patch_line_stats(out ctx, out add, out del, patch);
1311+
Ensure.ZeroResult(res);
1312+
return new Tuple<int, int>((int)add, (int)del);
1313+
}
1314+
}
1315+
13051316
#endregion
13061317

13071318
#region git_push_

0 commit comments

Comments
 (0)
0