Skip to content

Commit 2affbab

Browse files
committed
feat: add repo.references().pseudo() for traversing refs like HEAD and FETCH_HEAD.
1 parent fdf5153 commit 2affbab

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

gix/src/reference/iter.rs

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,8 @@ impl<'r> Iter<'r> {
3232
}
3333

3434
impl Platform<'_> {
35-
/// Return an iterator over all references in the repository.
35+
/// Return an iterator over all references in the repository, excluding
36+
/// pseudo references.
3637
///
3738
/// Even broken or otherwise unparsable or inaccessible references are returned and have to be handled by the caller on a
3839
/// case by case basis.
@@ -69,6 +70,12 @@ impl Platform<'_> {
6970
))
7071
}
7172

73+
// TODO: tests
74+
/// Return an iterator over all local pseudo references.
75+
pub fn pseudo_refs(&self) -> Result<Iter<'_>, init::Error> {
76+
Ok(Iter::new(self.repo, self.platform.psuedo_refs()?))
77+
}
78+
7279
// TODO: tests
7380
/// Return an iterator over all remote branches.
7481
///

0 commit comments

Comments
 (0)