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

rhgitaly::oid: methods for tree handling

There are for now completely identical to methods for blobs,
but they could well become different (e.g, different disk caches or
whatever).
parent 721ac5a4
No related branches found
No related tags found
3 merge requests!186Merging stable branch into default,!184Merged/adapted oldstable into stable for RHGitaly methods,!179RHGitaly CommitService.TreeEntry implementation
......@@ -58,6 +58,15 @@
Ok((oid, path.ok_or(OidError::MissingPath)?))
}
pub fn tree_oid<P: AsRef<[u8]> + ?Sized>(changeset_id: &Node, path: &P) -> String {
concat_chgsid_path(changeset_id, path)
}
pub fn extract_tree_oid(oid: &str) -> Result<(Node, Vec<u8>), OidError> {
let (oid, path) = split_chgsid_path(oid)?;
Ok((oid, path.ok_or(OidError::MissingPath)?))
}
#[cfg(test)]
/// Same test data as in Python hgitaly.tests.test_oid
mod tests {
......
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