Skip to content
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit 93ceaf5

Browse files
committedJan 4, 2024
fix #2071 ObjectDatabase.Write<T>(Stream, long) does not respect T
1 parent 8950f49 commit 93ceaf5

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed
 

‎LibGit2Sharp/ObjectDatabase.cs

+1-1
Original file line numberDiff line numberDiff line change
@@ -202,7 +202,7 @@ public virtual ObjectId Write<T>(Stream stream, long numberOfBytesToConsume) whe
202202
throw new ArgumentException("The stream cannot be read from.", "stream");
203203
}
204204

205-
using (var odbStream = Proxy.git_odb_open_wstream(handle, numberOfBytesToConsume, GitObjectType.Blob))
205+
using (var odbStream = Proxy.git_odb_open_wstream(handle, numberOfBytesToConsume, GitObject.TypeToGitKindMap[typeof(T)]))
206206
{
207207
var buffer = new byte[4 * 1024];
208208
long totalRead = 0;

0 commit comments

Comments
 (0)
Please sign in to comment.