Skip to content

Commit 5fd6364

Browse files
committed
feat: add entry::Mode::is_submodule()
1 parent 9fe3052 commit 5fd6364

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

gix-index/src/entry/mode.rs

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,16 @@
11
use crate::entry::Mode;
22

33
impl Mode {
4-
/// Return true if this is a sparse entry, as it points to a directory which usually isn't what an 'unsparse' index tracks.
4+
/// Return `true` if this is a sparse entry, as it points to a directory which usually isn't what an 'unsparse' index tracks.
55
pub fn is_sparse(&self) -> bool {
66
*self == Self::DIR
77
}
88

9+
/// Return `true` if this is a submodule entry.
10+
pub fn is_submodule(&self) -> bool {
11+
*self == Self::DIR | Self::SYMLINK
12+
}
13+
914
/// Compares this mode to the file system version ([`std::fs::symlink_metadata`])
1015
/// and returns the change needed to update this mode to match the file.
1116
///

0 commit comments

Comments
 (0)