diff --git a/radicle-surf/src/repo.rs b/radicle-surf/src/repo.rs index 9d75350..c9cf52b 100644 --- a/radicle-surf/src/repo.rs +++ b/radicle-surf/src/repo.rs @@ -284,8 +284,14 @@ impl Repository { Ok(Tree::new(dir.id(), entries, last_commit)) } + /// Returns a [`Blob`] for an `oid`. + pub fn blob(&self, oid: Oid) -> Result>, Error> { + let git2_blob = self.find_blob(oid)?; + Ok(Blob::>::new(file.id(), git2_blob, last_commit)) + } + /// Returns a [`Blob`] for `path` in `commit`. - pub fn blob<'a, C: ToCommit, P: AsRef>( + pub fn blob_at<'a, C: ToCommit, P: AsRef>( &'a self, commit: C, path: &P,