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:
Diffstat (limited to 'LibGit2Sharp/OdbBackendStream.cs')
-rw-r--r--LibGit2Sharp/OdbBackendStream.cs20
1 files changed, 5 insertions, 15 deletions
diff --git a/LibGit2Sharp/OdbBackendStream.cs b/LibGit2Sharp/OdbBackendStream.cs
index a1012f5f..2bb7b845 100644
--- a/LibGit2Sharp/OdbBackendStream.cs
+++ b/LibGit2Sharp/OdbBackendStream.cs
@@ -73,10 +73,10 @@ namespace LibGit2Sharp
long length);
/// <summary>
- /// After all bytes have been written to the stream, the object ID can be retrieved by calling FinalizeWrite.
+ /// After all bytes have been written to the stream, the object ID is provided to FinalizeWrite.
/// </summary>
public abstract int FinalizeWrite(
- out byte[] oid);
+ byte[] oid);
/// <summary>
/// The backend object this stream was created by.
@@ -193,26 +193,16 @@ namespace LibGit2Sharp
}
private static int FinalizeWrite(
- out GitOid oid_p,
- IntPtr stream)
+ IntPtr stream,
+ ref GitOid oid)
{
- oid_p = default(GitOid);
-
OdbBackendStream odbBackendStream = GCHandle.FromIntPtr(Marshal.ReadIntPtr(stream, GitOdbBackendStream.GCHandleOffset)).Target as OdbBackendStream;
if (odbBackendStream != null)
{
- byte[] computedObjectId;
-
try
{
- int toReturn = odbBackendStream.FinalizeWrite(out computedObjectId);
-
- if (0 == toReturn)
- {
- oid_p.Id = computedObjectId;
- }
-
+ int toReturn = odbBackendStream.FinalizeWrite(oid.Id);
return toReturn;
}
catch (Exception ex)