Skip to content

Commit ec662a9

Browse files
committed
fixup! Moar
1 parent 9aa7a33 commit ec662a9

File tree

2 files changed

+15
-24
lines changed

2 files changed

+15
-24
lines changed

LibGit2Sharp/ObjectDatabase.cs

Lines changed: 7 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -131,10 +131,10 @@ public virtual void AddBackend(OdbBackend backend, int priority)
131131
private class Processor
132132
{
133133
private readonly Stream stream;
134-
private readonly int? numberOfBytesToConsume;
134+
private readonly long? numberOfBytesToConsume;
135135
private int totalNumberOfReadBytes;
136136

137-
public Processor(Stream stream, int? numberOfBytesToConsume)
137+
public Processor(Stream stream, long? numberOfBytesToConsume)
138138
{
139139
this.stream = stream;
140140
this.numberOfBytesToConsume = numberOfBytesToConsume;
@@ -148,11 +148,11 @@ public int Provider(IntPtr content, int max_length, IntPtr data)
148148

149149
if (numberOfBytesToConsume.HasValue)
150150
{
151-
int totalRemainingBytesToRead = numberOfBytesToConsume.Value - totalNumberOfReadBytes;
151+
long totalRemainingBytesToRead = numberOfBytesToConsume.Value - totalNumberOfReadBytes;
152152

153153
if (totalRemainingBytesToRead < max_length)
154154
{
155-
bytesToRead = totalRemainingBytesToRead;
155+
bytesToRead = totalRemainingBytesToRead > int.MaxValue ? int.MaxValue : (int)totalRemainingBytesToRead;
156156
}
157157
}
158158

@@ -208,12 +208,12 @@ public virtual Blob CreateBlob(Stream stream, string hintpath)
208208
/// <param name="hintpath">The hintpath is used to determine what git filters should be applied to the object before it can be placed to the object database.</param>
209209
/// <param name="numberOfBytesToConsume">The number of bytes to consume from the stream.</param>
210210
/// <returns>The created <see cref="Blob"/>.</returns>
211-
public virtual Blob CreateBlob(Stream stream, string hintpath, int numberOfBytesToConsume)
211+
public virtual Blob CreateBlob(Stream stream, string hintpath, long numberOfBytesToConsume)
212212
{
213-
return CreateBlob(stream, hintpath, (int?)numberOfBytesToConsume);
213+
return CreateBlob(stream, hintpath, (long?)numberOfBytesToConsume);
214214
}
215215

216-
internal Blob CreateBlob(Stream stream, string hintpath, int? numberOfBytesToConsume)
216+
private Blob CreateBlob(Stream stream, string hintpath, long? numberOfBytesToConsume)
217217
{
218218
Ensure.ArgumentNotNull(stream, "stream");
219219

@@ -234,18 +234,6 @@ internal Blob CreateBlob(Stream stream, string hintpath, int? numberOfBytesToCon
234234
return repo.Lookup<Blob>(id);
235235
}
236236

237-
/// <summary>
238-
/// Inserts a <see cref="Blob"/> into the object database created from the content of the stream.
239-
/// </summary>
240-
/// <param name="stream">The stream from which will be read the content of the blob to be created.</param>
241-
/// <param name="numberOfBytesToConsume">Number of bytes to consume from the stream.</param>
242-
/// <returns>The created <see cref="Blob"/>.</returns>
243-
[Obsolete("This method will be removed in the next release. Please use CreateBlob(Stream stream, long) instead.")]
244-
public virtual Blob CreateBlob(Stream stream, int numberOfBytesToConsume)
245-
{
246-
return CreateBlob(stream, (long)numberOfBytesToConsume);
247-
}
248-
249237
/// <summary>
250238
/// Inserts a <see cref="Blob"/> into the object database created from the content of the stream.
251239
/// </summary>
@@ -254,7 +242,6 @@ public virtual Blob CreateBlob(Stream stream, int numberOfBytesToConsume)
254242
/// <returns>The created <see cref="Blob"/>.</returns>
255243
public virtual Blob CreateBlob(Stream stream, long numberOfBytesToConsume)
256244
{
257-
258245
Ensure.ArgumentNotNull(stream, "stream");
259246

260247
if (!stream.CanRead)

LibGit2Sharp/RemoteUpdater.cs

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -36,22 +36,26 @@ internal RemoteUpdater(Repository repo, Remote remote)
3636

3737
private IEnumerable<string> GetFetchRefSpecs()
3838
{
39-
return Proxy.git_remote_get_fetch_refspecs(remoteHandle);
39+
throw new NotImplementedException();
40+
//return Proxy.git_remote_get_fetch_refspecs(remoteHandle);
4041
}
4142

4243
private void SetFetchRefSpecs(IEnumerable<string> value)
4344
{
44-
Proxy.git_remote_set_fetch_refspecs(remoteHandle, value);
45+
throw new NotImplementedException();
46+
//Proxy.git_remote_set_fetch_refspecs(remoteHandle, value);
4547
}
4648

4749
private IEnumerable<string> GetPushRefSpecs()
4850
{
49-
return Proxy.git_remote_get_push_refspecs(remoteHandle);
51+
throw new NotImplementedException();
52+
//return Proxy.git_remote_get_push_refspecs(remoteHandle);
5053
}
5154

5255
private void SetPushRefSpecs(IEnumerable<string> value)
5356
{
54-
Proxy.git_remote_set_push_refspecs(remoteHandle, value);
57+
throw new NotImplementedException();
58+
//Proxy.git_remote_set_push_refspecs(remoteHandle, value);
5559
}
5660

5761
/// <summary>

0 commit comments

Comments
 (0)