Rust 1.67 was announced[0].
Update the nix sources to be on par with the latest rustc version.
This required fixes to clippy warnings for using variable
interpolation for format strings.
There was also an advisory error related to libgit2-sys[1], which is
transitively depended on via git2. The fix is included in the 0.16.1
version of git2.
[0]: https://blog.rust-lang.org/2023/01/26/Rust-1.67.0.html
[1]: https://rustsec.org/advisories/RUSTSEC-2023-0003
Signed-off-by: Fintan Halpenny <fintan.halpenny@gmail.com>
X-Clacks-Overhead: GNU Terry Pratchett
There is an advisory error[0] relating to tokio which is transitively
brought in via deadpool.
Since git-storage is not currently used and heartwood is avoiding any
async runtimes, the pool module is removed.
[0]: https://rustsec.org/advisories/RUSTSEC-2023-0001.html
Signed-off-by: Fintan Halpenny <fintan.halpenny@gmail.com>
X-Clacks-Overhead: GNU Terry Pratchett
We add tests for ODB functionality, as well as a new `TreeBuilder`
Struct to make building git trees easier (see below).
The `git2::TreeBuilder` can be a pain to use since it has a lifetime
that is tied to the `git2::Repository`. This was causing issues when
trying to write generators for property tests.
Instead, define a custom TreeBuilder which is a defunctionalised list
operations that represent the `insert` and `remove` methods on
`git2::TreeBuilder`.
The implementation of writing a tree then becomes converting the
custom `TreeBuilder` into a `git2::TreeBuilder`.
Signed-off-by: Jorge Iglesias Garcia <me@jorgeig.com>
The idea of an owner came from radicle-link storing the signer in the
storage which was needed for performing signing when writing
particular rad references. The peer_id and personal identity was also
stored within the monorepo config.
Since git-storage is just general reading & writing of references and
objects, these concepts are not necessarily needed at this
level. Remove the owner from Write and remove the config module.
Signed-off-by: Fintan Halpenny <fintan.halpenny@gmail.com>
When an object does not exist the `find_*` functions will return
None. It will be a common case that users of the API will follow the
pattern of `find_blob(store, oid)?.ok_or(Error::NotFound)`.
Add fallible functions corresponding to each `find_` function
returning a `git2::Error` if the object is not found.
Signed-off-by: Fintan Halpenny <fintan.halpenny@gmail.com>
The Updated values only tell the updated value of the target. It can
be useful to also return the previous value, e.g. for reporting,
hooks, etc.
Add `Option<Oid>` to the Update::Direct and Update::Symbolic variants.
Signed-off-by: Fintan Halpenny <fintan.halpenny@gmail.com>