Example #1
0
        /// <inheritdoc />
        public override int ReadStream(LibGit2Sharp.ObjectId id, out OdbBackendStream stream)
        {
            var lastItem = _lastItem; // Thread safety

            if (lastItem?.Sha.Equals(id.Sha, StringComparison.OrdinalIgnoreCase) ?? false)
            {
                stream = new LiteDbOdbBackendStream(this, new MemoryStream(lastItem.Data));
                return((int)ReturnCode.GIT_OK);
            }
            var entry = _database.FileStorage.FindById(id.Sha);

            if (entry != null)
            {
                stream = new LiteDbOdbBackendStream(this, entry.OpenRead());
                return((int)ReturnCode.GIT_OK);
            }
            else
            {
                stream = default;
                return((int)ReturnCode.GIT_ENOTFOUND);
            }
        }
Example #2
0
 public override int ReadStream(ObjectId oid, out OdbBackendStream stream)
 {
     throw new NotImplementedException();
 }
Example #3
0
            public override int WriteStream(long length, ObjectType objectType, out OdbBackendStream stream)
            {
                stream = new MockOdbBackendStream(this, objectType, length);

                return((int)ReturnCode.GIT_OK);
            }
            public override int WriteStream(long length, ObjectType objectType, out OdbBackendStream stream)
            {
                stream = new MockOdbBackendStream(this, objectType, length);

                return (int)ReturnCode.GIT_OK;
            }
 public override int ReadStream(ObjectId oid, out OdbBackendStream stream)
 {
     throw new NotImplementedException();
 }
Example #6
0
 public override int ReadStream(ObjectId oid, out OdbBackendStream stream)
 {
     throw this.exceptionToThrow;
 }
Example #7
0
 public override int WriteStream(long length, ObjectType objectType, out OdbBackendStream stream)
 {
     throw this.exceptionToThrow;
 }
Example #8
0
 public override int WriteStream(long length, ObjectType objectType, out OdbBackendStream stream)
 {
     throw this.exceptionToThrow;
 }
Example #9
0
 public override int ReadStream(ObjectId oid, out OdbBackendStream stream)
 {
     throw this.exceptionToThrow;
 }
 public override int WriteStream(long length, ObjectType objectType, out OdbBackendStream stream)
 {
     throw new NotImplementedException("WriteStream");
 }