diff options
author | nulltoken <emeric.fermas@gmail.com> | 2011-09-20 17:50:33 +0400 |
---|---|---|
committer | Emeric Fermas <emeric.fermas@gmail.com> | 2011-09-29 02:01:18 +0400 |
commit | 83735193fffbbd31ab3eb205ed6b814d6a1a76e7 (patch) | |
tree | 5a9669ed3831ede10e27f5453d0ac4ed86f125be /LibGit2Sharp/Signature.cs | |
parent | 37997dceb32d3dcf9f3650af5b3daaf8ddde9ffd (diff) |
Upgrade libgit2 binaries to 35e9407
Diffstat (limited to 'LibGit2Sharp/Signature.cs')
-rw-r--r-- | LibGit2Sharp/Signature.cs | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/LibGit2Sharp/Signature.cs b/LibGit2Sharp/Signature.cs index a9ede163..fe486740 100644 --- a/LibGit2Sharp/Signature.cs +++ b/LibGit2Sharp/Signature.cs @@ -28,10 +28,19 @@ namespace LibGit2Sharp /// <param name = "email">The email.</param> /// <param name = "when">The when.</param> public Signature(string name, string email, DateTimeOffset when) - : this(NativeMethods.git_signature_new(name, email, when.ToSecondsSinceEpoch(), (int)when.Offset.TotalMinutes), false) + : this(CreateSignature(name, email, when), false) { } + private static IntPtr CreateSignature(string name, string email, DateTimeOffset when) + { + IntPtr signature; + int result = NativeMethods.git_signature_new(out signature, name, email, when.ToSecondsSinceEpoch(), (int)when.Offset.TotalMinutes); + Ensure.Success(result); + + return signature; + } + internal GitSignature Handle { get { return handle; } |