File tree Expand file tree Collapse file tree 1 file changed +23
-0
lines changed Expand file tree Collapse file tree 1 file changed +23
-0
lines changed Original file line number Diff line number Diff line change @@ -3461,5 +3461,28 @@ internal static int ConvertResultToCancelFlag(bool result)
3461
3461
return result ? 0 : ( int ) GitErrorCode . User ;
3462
3462
}
3463
3463
}
3464
+
3465
+ /// <summary>
3466
+ /// Class to hold extension methods used by the proxy class.
3467
+ /// </summary>
3468
+ static class ProxyExtensions
3469
+ {
3470
+ /// <summary>
3471
+ /// Convert a UIntPtr to a int value. Will throw
3472
+ /// exception if there is an overflow.
3473
+ /// </summary>
3474
+ /// <param name="input"></param>
3475
+ /// <returns></returns>
3476
+ public static int ConvertToInt ( this UIntPtr input )
3477
+ {
3478
+ ulong ulongValue = ( ulong ) input ;
3479
+ if ( ulongValue > int . MaxValue )
3480
+ {
3481
+ throw new LibGit2SharpException ( "value exceeds size of an int" ) ;
3482
+ }
3483
+
3484
+ return ( int ) input ;
3485
+ }
3486
+ }
3464
3487
}
3465
3488
// ReSharper restore InconsistentNaming
You can’t perform that action at this time.
0 commit comments