Two of the tests in radicle-git-ext and radicle-surf relied on using
the Git repository itself. This can end up being an issue when
sandboxing is involved.
This improves the situation by being able to generate commit data to
add to a temporary repository.
It also adds a helper for creating a local, temporary submodule for
testing the submodule interactions in the radicle-surf API.
Signed-off-by: Fintan Halpenny <fintan.halpenny@gmail.com>
X-Clacks-Overhead: GNU Terry Pratchett
Move git-commit, git-trailers, and link-git to an archived directory
to hide them away -- showing the intent that radicle-git-ext will be
the main crate for git functionality.
Signed-off-by: Fintan Halpenny <fintan.halpenny@gmail.com>
X-Clacks-Overhead: GNU Terry Pratchett
A vulnerability in a transitive dependency, remove_dir_all, used by
tempfile was found[0].
Update tempfile to 3.4, which does not depend on remove_dir_all.
[0]: https://rustsec.org/advisories/RUSTSEC-2023-0018
Signed-off-by: Fintan Halpenny <fintan.halpenny@gmail.com>
X-Clacks-Overhead: GNU Terry Pratchett
Adds a roundtrip helper for going to/from a json value. This can have
slightly different semantics in comparison to/from a json string.
Signed-off-by: Fintan Halpenny <fintan.halpenny@gmail.com>
X-Clacks-Overhead: GNU Terry Pratchett
Instead of creating a named feature flag, opt for using the `serde`
package name as the feature flag name. This makes it more clear that
the feature is only enabling serde serialization and nothing else.
This patch also cleans up the testing flags by removing the serialize
flag for testing, as this should just always be tested, and also adds
the syntax flag for future testing.
Signed-off-by: Fintan Halpenny <fintan.halpenny@gmail.com>
X-Clacks-Overhead: GNU Terry Pratchett
Reorganise the tests into module files, rather than all being in a
single file. No tests were changed in this patch.
The `serialize` flag was also not enabled in `test/Cargo.toml`. This
is enabled to ensure those tests are run moving forward.
Signed-off-by: Fintan Halpenny <fintan.halpenny@gmail.com>
X-Clacks-Overhead: GNU Terry Pratchett
The aim of this patch is to solve some of the `cargo deny`
warnings. This required updating some dependencies. Some dependencies
of radicle-surf were not used, so they were outright removed.
The last_commit benchmark in radicle-surf is irrelevant as we use more
efficient methods for getting repository histories, so it has been
removed.
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>
To help with clarity and potential publishing of the crates, the full
`radicle-` prefix is used for the crate names.
Note that it wasn't chosen got `git-ref-format` and `git-trailers`
since they are truly general libraries (bar the feature flag for link
specific reference names).
Signed-off-by: Fintan Halpenny <fintan.halpenny@gmail.com>
Port over all git relevant parts of the radicle-link repository[0].
The packages that are kept are:
* git-ext
* git-ref-format
* git-trailers
* link-git
* macros
* std-ext
* test -- only the portions that test the above
The development and testing scripts are also added for local and CI
testing.
[0]: https://github.com/radicle-dev/radicle-link/
Signed-off-by: Fintan Halpenny <fintan.halpenny@gmail.com>