Files
radicle-git/radicle-surf/Cargo.toml
T
Fintan Halpenny 2391c25e95 surf: add submodule support
Git [submodules] are encoded as commits when walking a Git tree. To
allow the support of them in `radicle-surf`, the tree entry is checked
for this case. The entry will be treated such that it is has a name,
prefix, Oid, and the submodule's URL.

It's important to note that the Oid is not usable within the context
of the repository that is being browsed, since they are entirely
separate.

Instead, the URL should be used in conjunction with the Oid for
browsing purposes outside of `radicle-surf`. However, in a future
iteration it may be considered to be able to browse the local contents
of the submodule, if possible.

N.b. getting the submodule and its URL is not supported for a bare
repository, since it will complain about not having a working tree.

[submodules]: https://git-scm.com/book/en/v2/Git-Tools-Submodules

Signed-off-by: Fintan Halpenny <fintan.halpenny@gmail.com>
X-Clacks-Overhead: GNU Terry Pratchett
2024-03-06 15:59:57 +00:00

63 lines
1.3 KiB
TOML

[package]
name = "radicle-surf"
description = "A code surfing library for Git repositories"
readme = "README.md"
version = "0.18.0"
authors = ["The Radicle Team <dev@radicle.xyz>"]
edition = "2021"
homepage = "https://github.com/radicle-dev/radicle-git/blob/main/radicle-surf/README.md"
repository = "https://github.com/radicle-dev/radicle-git/tree/main/radicle-surf"
license = "GPL-3.0-or-later"
include = [
"**/*.rs",
"Cargo.toml",
"data/git-platinum.tgz",
]
[lib]
test = false
doctest = false
[features]
# NOTE: testing `test_submodule_failure` on GH actions
# is painful since it uses this specific repo and expects
# certain branches to be setup. So we use this feature flag
# to ignore the test on CI.
gh-actions = []
minicbor = ["radicle-git-ext/minicbor"]
serde = ["dep:serde", "url/serde"]
[dependencies]
base64 = "0.13"
log = "0.4"
nonempty = "0.5"
thiserror = "1.0"
[dependencies.git2]
version = "0.18.1"
default-features = false
features = ["vendored-libgit2"]
[dependencies.radicle-git-ext]
version = "0.7.0"
path = "../radicle-git-ext"
features = ["serde"]
[dependencies.radicle-std-ext]
version = "0.1.0"
path = "../radicle-std-ext"
[dependencies.serde]
version = "1"
features = ["serde_derive"]
optional = true
[dependencies.url]
version = "2.5"
[build-dependencies]
anyhow = "1.0"
flate2 = "1"
tar = "0.4"