/// <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); } }
public override int ReadStream(ObjectId oid, out OdbBackendStream stream) { throw new NotImplementedException(); }
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 this.exceptionToThrow; }
public override int WriteStream(long length, ObjectType objectType, out OdbBackendStream stream) { throw this.exceptionToThrow; }
public override int WriteStream(long length, ObjectType objectType, out OdbBackendStream stream) { throw new NotImplementedException("WriteStream"); }