A couple of docs and naming improvements
Signed-off-by: Alexis Sellier <alexis@radicle.xyz>
This commit is contained in:
parent
8b834a7b6e
commit
5f4fc8236e
|
|
@ -244,8 +244,8 @@ pub trait ReadRepository {
|
||||||
|
|
||||||
/// Get the head of this repository.
|
/// Get the head of this repository.
|
||||||
///
|
///
|
||||||
/// Returns the value of `HEAD` if it is set, otherwise computes the canonical head
|
/// Returns the reference pointed to by `HEAD` if it is set. Otherwise, computes the canonical
|
||||||
/// using [`ReadRepository::canonical_head`].
|
/// head using [`ReadRepository::canonical_head`].
|
||||||
///
|
///
|
||||||
/// Returns the [`Oid`] as well as the qualified reference name.
|
/// Returns the [`Oid`] as well as the qualified reference name.
|
||||||
fn head(&self) -> Result<(Qualified, Oid), ProjectError>;
|
fn head(&self) -> Result<(Qualified, Oid), ProjectError>;
|
||||||
|
|
|
||||||
|
|
@ -233,7 +233,7 @@ impl Repository {
|
||||||
})
|
})
|
||||||
.collect::<Result<_, VerifyError>>()?;
|
.collect::<Result<_, VerifyError>>()?;
|
||||||
|
|
||||||
for entry in self.public_references()? {
|
for entry in self.namespaced_references()? {
|
||||||
let (remote_id, refname, oid) = entry?;
|
let (remote_id, refname, oid) = entry?;
|
||||||
let remote = remotes
|
let remote = remotes
|
||||||
.get_mut(&remote_id)
|
.get_mut(&remote_id)
|
||||||
|
|
@ -368,8 +368,8 @@ impl Repository {
|
||||||
Ok(remotes)
|
Ok(remotes)
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Return all references that are public, ie. that are replicated, verified and signed.
|
/// Return all references that are namespaced, ie. that are signed by a node and verified.
|
||||||
fn public_references(
|
fn namespaced_references(
|
||||||
&self,
|
&self,
|
||||||
) -> Result<impl Iterator<Item = Result<(RemoteId, Qualified, Oid), refs::Error>>, git2::Error>
|
) -> Result<impl Iterator<Item = Result<(RemoteId, Qualified, Oid), refs::Error>>, git2::Error>
|
||||||
{
|
{
|
||||||
|
|
@ -877,7 +877,7 @@ mod tests {
|
||||||
}
|
}
|
||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
fn test_public_references() {
|
fn test_namespaced_references() {
|
||||||
let tmp = tempfile::tempdir().unwrap();
|
let tmp = tempfile::tempdir().unwrap();
|
||||||
let signer = MockSigner::default();
|
let signer = MockSigner::default();
|
||||||
let storage = Storage::open(tmp.path().join("storage")).unwrap();
|
let storage = Storage::open(tmp.path().join("storage")).unwrap();
|
||||||
|
|
@ -886,7 +886,7 @@ mod tests {
|
||||||
let proj = storage.repository(id).unwrap();
|
let proj = storage.repository(id).unwrap();
|
||||||
|
|
||||||
let mut refs = proj
|
let mut refs = proj
|
||||||
.public_references()
|
.namespaced_references()
|
||||||
.unwrap()
|
.unwrap()
|
||||||
.map(|r| r.unwrap())
|
.map(|r| r.unwrap())
|
||||||
.map(|(_, r, _)| r.to_string())
|
.map(|(_, r, _)| r.to_string())
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue