diff --git a/src/repo.rs b/src/repo.rs index b2bff1d..afda6ab 100644 --- a/src/repo.rs +++ b/src/repo.rs @@ -659,6 +659,14 @@ impl RepoHandle { .collect::, String>>() } + pub fn remote_branches(&self) -> Result, String> { + self.0 + .branches(Some(git2::BranchType::Remote)) + .map_err(convert_libgit2_error)? + .map(|branch| Ok(Branch(branch.map_err(convert_libgit2_error)?.0))) + .collect::, String>>() + } + pub fn fetch(&self, remote_name: &str) -> Result<(), String> { let mut remote = self .0