Skip to content
Snippets Groups Projects
Commit bcab7028 authored by Georges Racinet's avatar Georges Racinet
Browse files

RHGitaly: reading GitLab ref files

This follows the file format and conventions defined in the server side
`heptapod` Python package.

Since everything is async, we actually provide Streams of TypedRef objects,
and the `map_lookup_typed_ref` for the numerous use cases when one is looking
for a specific ref.

The file format is very primitive, so all we can do at this point is to
perform a full scan, but it has room (version preamble) for more advanced
formats in the future (e.g, append-only persistent hash map or similar).

A preliminary version of this was using Tokio's `LineStream`, but this
has several drawbacks:

- it is unicode-centric, yielding `String`s
- we had to implement our own `Stream`, keeping the `LineStream` as
  a field. Hence because `poll_next()` takes `&mut Pin<Self>` we had
  to write a pinning accessor, which is unsafe (see the doc for `std::pin`
  for more details).
parent 29fc9a2b
No related branches found
No related tags found
2 merge requests!169Protocol v15.9 and stable branch merge",!166RHGitaly: reading GitLab ref state files, implementing RefService.RefExists
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment