@@ -55,22 +55,22 @@ protected unsafe Stream Allocate(long bytes)
55
55
/// </summary>
56
56
public abstract int Read ( byte [ ] oid ,
57
57
out Stream data ,
58
- out GitObjectType objectType ) ;
58
+ out ObjectType objectType ) ;
59
59
60
60
/// <summary>
61
61
/// Requests that this backend read an object. The object ID may not be complete (may be a prefix).
62
62
/// </summary>
63
63
public abstract int ReadPrefix ( byte [ ] shortOid ,
64
64
out byte [ ] oid ,
65
65
out Stream data ,
66
- out GitObjectType objectType ) ;
66
+ out ObjectType objectType ) ;
67
67
68
68
/// <summary>
69
69
/// Requests that this backend read an object's header (length and object type) but not its contents.
70
70
/// </summary>
71
71
public abstract int ReadHeader ( byte [ ] oid ,
72
72
out int length ,
73
- out GitObjectType objectType ) ;
73
+ out ObjectType objectType ) ;
74
74
75
75
/// <summary>
76
76
/// Requests that this backend write an object to the backing store. The backend may need to compute the object ID
@@ -79,7 +79,7 @@ public abstract int ReadHeader(byte[] oid,
79
79
public abstract int Write ( byte [ ] oid ,
80
80
Stream dataStream ,
81
81
long length ,
82
- GitObjectType objectType ,
82
+ ObjectType objectType ,
83
83
out byte [ ] finalOid ) ;
84
84
85
85
/// <summary>
@@ -93,7 +93,7 @@ public abstract int ReadStream(byte[] oid,
93
93
/// the data in chunks.
94
94
/// </summary>
95
95
public abstract int WriteStream ( long length ,
96
- GitObjectType objectType ,
96
+ ObjectType objectType ,
97
97
out OdbBackendStream stream ) ;
98
98
99
99
/// <summary>
@@ -210,7 +210,7 @@ private unsafe static int Read(
210
210
if ( odbBackend != null )
211
211
{
212
212
Stream dataStream = null ;
213
- GitObjectType objectType ;
213
+ ObjectType objectType ;
214
214
215
215
try
216
216
{
@@ -227,7 +227,7 @@ private unsafe static int Read(
227
227
}
228
228
229
229
len_p = new UIntPtr ( ( ulong ) memoryStream . Capacity ) ;
230
- type_p = objectType ;
230
+ type_p = objectType . ToGitObjectType ( ) ;
231
231
232
232
memoryStream . Seek ( 0 , SeekOrigin . Begin ) ;
233
233
buffer_p = new IntPtr ( memoryStream . PositionPointer ) ;
@@ -271,7 +271,7 @@ private unsafe static int ReadPrefix(
271
271
{
272
272
byte [ ] oid ;
273
273
Stream dataStream = null ;
274
- GitObjectType objectType ;
274
+ ObjectType objectType ;
275
275
276
276
try
277
277
{
@@ -294,7 +294,7 @@ private unsafe static int ReadPrefix(
294
294
295
295
out_oid . Id = oid ;
296
296
len_p = new UIntPtr ( ( ulong ) memoryStream . Capacity ) ;
297
- type_p = objectType ;
297
+ type_p = objectType . ToGitObjectType ( ) ;
298
298
299
299
memoryStream . Seek ( 0 , SeekOrigin . Begin ) ;
300
300
buffer_p = new IntPtr ( memoryStream . PositionPointer ) ;
@@ -332,7 +332,7 @@ private static int ReadHeader(
332
332
if ( odbBackend != null )
333
333
{
334
334
int length ;
335
- GitObjectType objectType ;
335
+ ObjectType objectType ;
336
336
337
337
try
338
338
{
@@ -341,7 +341,7 @@ private static int ReadHeader(
341
341
if ( 0 == toReturn )
342
342
{
343
343
len_p = new UIntPtr ( ( uint ) length ) ;
344
- type_p = objectType ;
344
+ type_p = objectType . ToGitObjectType ( ) ;
345
345
}
346
346
347
347
return toReturn ;
@@ -364,6 +364,8 @@ private static unsafe int Write(
364
364
{
365
365
OdbBackend odbBackend = GCHandle . FromIntPtr ( Marshal . ReadIntPtr ( backend , GitOdbBackend . GCHandleOffset ) ) . Target as OdbBackend ;
366
366
367
+ ObjectType objectType = type . ToObjectType ( ) ;
368
+
367
369
if ( odbBackend != null &&
368
370
len . ToUInt64 ( ) < long . MaxValue )
369
371
{
@@ -373,7 +375,7 @@ private static unsafe int Write(
373
375
{
374
376
byte [ ] finalOid ;
375
377
376
- int toReturn = odbBackend . Write ( oid . Id , stream , ( long ) len . ToUInt64 ( ) , type , out finalOid ) ;
378
+ int toReturn = odbBackend . Write ( oid . Id , stream , ( long ) len . ToUInt64 ( ) , objectType , out finalOid ) ;
377
379
378
380
if ( 0 == toReturn )
379
381
{
@@ -402,14 +404,16 @@ private static int WriteStream(
402
404
403
405
OdbBackend odbBackend = GCHandle . FromIntPtr ( Marshal . ReadIntPtr ( backend , GitOdbBackend . GCHandleOffset ) ) . Target as OdbBackend ;
404
406
407
+ ObjectType objectType = type . ToObjectType ( ) ;
408
+
405
409
if ( odbBackend != null &&
406
410
length . ToUInt64 ( ) < long . MaxValue )
407
411
{
408
412
OdbBackendStream stream ;
409
413
410
414
try
411
415
{
412
- int toReturn = odbBackend . WriteStream ( ( long ) length . ToUInt64 ( ) , type , out stream ) ;
416
+ int toReturn = odbBackend . WriteStream ( ( long ) length . ToUInt64 ( ) , objectType , out stream ) ;
413
417
414
418
if ( 0 == toReturn )
415
419
{
0 commit comments