diff --git a/LibGit2Sharp/ObjectDatabase.cs b/LibGit2Sharp/ObjectDatabase.cs index 3a4ebcdb6..55a1cda6e 100644 --- a/LibGit2Sharp/ObjectDatabase.cs +++ b/LibGit2Sharp/ObjectDatabase.cs @@ -202,7 +202,7 @@ public virtual ObjectId Write(Stream stream, long numberOfBytesToConsume) whe throw new ArgumentException("The stream cannot be read from.", "stream"); } - using (var odbStream = Proxy.git_odb_open_wstream(handle, numberOfBytesToConsume, GitObjectType.Blob)) + using (var odbStream = Proxy.git_odb_open_wstream(handle, numberOfBytesToConsume, GitObject.TypeToGitKindMap[typeof(T)])) { var buffer = new byte[4 * 1024]; long totalRead = 0;