Skip to content

Commit 00610c3

Browse files
committed
ulongs
1 parent 73b239b commit 00610c3

File tree

2 files changed

+6
-5
lines changed

2 files changed

+6
-5
lines changed

LibGit2Sharp/Core/GitBufWriteStream.cs

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -46,18 +46,19 @@ private void AutoGrowBuffer(int count)
4646
{
4747
var gitBuf = gitBufPointer.MarshalAs<GitBuf>();
4848

49-
var asize = (uint)gitBuf.asize;
50-
var size = (uint)gitBuf.size;
49+
var ulongCount = Convert.ToUInt64(count);
50+
var asize = (ulong)gitBuf.asize;
51+
var size = (ulong)gitBuf.size;
5152

52-
var isBufferLargeEnoughToHoldTheNewData = (asize - size) > count;
53+
var isBufferLargeEnoughToHoldTheNewData = (asize - size) > ulongCount;
5354
var filledBufferPercentage = (100.0 * size / asize);
5455

5556
if (isBufferLargeEnoughToHoldTheNewData && filledBufferPercentage < 90)
5657
{
5758
return;
5859
}
5960

60-
var targetSize = (uint)(1.5 * (asize + count));
61+
var targetSize = (ulong)(1.5 * (asize + ulongCount));
6162

6263
Proxy.git_buf_grow(gitBufPointer, targetSize);
6364
}

LibGit2Sharp/Core/Proxy.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -241,7 +241,7 @@ public static string git_branch_upstream_name(RepositorySafeHandle handle, strin
241241

242242
#region git_buf_
243243

244-
public static void git_buf_grow(IntPtr gitBufPointer, uint target_size)
244+
public static void git_buf_grow(IntPtr gitBufPointer, ulong target_size)
245245
{
246246
using (ThreadAffinity())
247247
{

0 commit comments

Comments
 (0)