Skip to content

Commit 1dc4568

Browse files
committed
Add rela_path to crate::status::index_worktree::iter::Item
1 parent a10a5fb commit 1dc4568

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

gix/src/status/index_worktree.rs

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -539,6 +539,15 @@ pub mod iter {
539539
}
540540
})
541541
}
542+
543+
/// The repository-relative path of the entry contained in this item.
544+
pub fn rela_path(&self) -> &BStr {
545+
match self {
546+
Item::Modification { rela_path, .. } => rela_path.as_ref(),
547+
Item::DirectoryContents { entry, .. } => entry.rela_path.as_ref(),
548+
Item::Rewrite { dirwalk_entry, .. } => dirwalk_entry.rela_path.as_ref(),
549+
}
550+
}
542551
}
543552

544553
impl<'index> From<gix_status::index_as_worktree_with_renames::Entry<'index, (), SubmoduleStatus>> for Item {

0 commit comments

Comments
 (0)