We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
2 parents 29cb775 + 154b21f commit ad6b9b6Copy full SHA for ad6b9b6
gitoxide-core/src/repository/clean.rs
@@ -188,9 +188,9 @@ pub(crate) mod function {
188
}
189
190
match disk_kind {
191
- Kind::NonFile => {
+ Kind::Untrackable => {
192
if debug {
193
- writeln!(err, "DBG: skipped non-file at '{}'", entry.rela_path).ok();
+ writeln!(err, "DBG: skipped untrackable entry at '{}'", entry.rela_path).ok();
194
195
continue;
196
@@ -265,7 +265,7 @@ pub(crate) mod function {
265
"WOULD remove"
266
},
267
suffix = match disk_kind {
268
- Kind::NonFile => unreachable!("always skipped earlier"),
+ Kind::Untrackable => unreachable!("always skipped earlier"),
269
Kind::Directory if entry.property == Some(gix::dir::entry::Property::EmptyDirectory) => {
270
" empty"
271
gix-dir/src/entry.rs
@@ -26,11 +26,14 @@ pub enum Property {
26
/// The kind of the entry, seated in their kinds available on disk.
27
#[derive(Debug, Clone, Copy, PartialEq, Eq, Hash, Ord, PartialOrd)]
28
pub enum Kind {
29
- /// Something that is not a file, like a named pipe or character device.
+ /// Something that is not a regular file, directory, or symbolic link.
30
///
31
- /// These can only exist in the filesystem.
32
- NonFile,
33
- /// The entry is a blob, executable or not.
+ /// These can only exist in the filesystem,
+ /// because Git repositories do not support them, thus they cannot be tracked.
+ /// Hence, they do not appear as blobs in a repository, and their type is not specifiable in a tree object.
34
+ /// Examples include named pipes (FIFOs), character devices, block devices, and sockets.
35
+ Untrackable,
36
+ /// The entry is a blob, representing a regular file, executable or not.
37
File,
38
/// The entry is a symlink.
39
Symlink,
@@ -161,7 +164,7 @@ impl From<std::fs::FileType> for Kind {
161
164
} else if value.is_file() {
162
165
Kind::File
163
166
} else {
- Kind::NonFile
167
+ Kind::Untrackable
168
169
170
gix-dir/tests/dir/walk.rs
@@ -68,8 +68,8 @@ fn one_top_level_fifo() {
68
69
assert_eq!(
70
entries,
71
- &[entry("top", Untracked, NonFile),],
72
- "Non-files are like normal files, but with a different state"
+ &[entry("top", Untracked, Untrackable),],
+ "Untrackable entries are like normal files, but with a different state"
73
);
74
75
@@ -103,11 +103,11 @@ fn fifo_in_traversal() {
103
&[
104
entry_nokind(".git", Pruned).with_property(DotGit).with_match(Always),
105
entry("dir-with-file/nested-file", Untracked, File),
106
- entry("dir/nested", Untracked, NonFile),
+ entry("dir/nested", Untracked, Untrackable),
107
entry("file", Untracked, File),
108
- entry("top", Untracked, NonFile),
+ entry("top", Untracked, Untrackable),
109
],
110
- "Non-files only differ by their disk-kind"
+ "Untrackable entries only differ by their disk-kind"
111
112
113
gix-status/src/index_as_worktree/types.rs
@@ -103,7 +103,9 @@ impl Outcome {
pub enum Change<T = (), U = ()> {
/// This corresponding file does not exist in the worktree anymore.
Removed,
- /// The type of file changed compared to the worktree, i.e. a symlink is now a file, or a file was replaced with a named pipe.
+ /// The type of file changed compared to the worktree.
+ ///
+ /// Examples include when a symlink is now a regular file, or a regular file was replaced with a named pipe.
/// ### Deviation
gix-status/src/index_as_worktree_with_renames/mod.rs
@@ -387,8 +387,8 @@ pub(super) mod function {
387
388
impl<T, U> gix_dir::walk::Delegate for Delegate<'_, '_, T, U> {
389
fn emit(&mut self, entry: EntryRef<'_>, collapsed_directory_status: Option<Status>) -> Action {
390
- // Status never shows untracked non-files
391
- if entry.disk_kind != Some(gix_dir::entry::Kind::NonFile) {
+ // Status never shows untracked entries of untrackable type
+ if entry.disk_kind != Some(gix_dir::entry::Kind::Untrackable) {
392
let entry = entry.to_owned();
393
self.tx.send(Event::DirEntry(entry, collapsed_directory_status)).ok();
394
@@ -469,7 +469,7 @@ pub(super) mod function {
469
ModificationOrDirwalkEntry::Modification(c) => c.entry.mode.to_tree_entry_mode(),
470
ModificationOrDirwalkEntry::DirwalkEntry { entry, .. } => entry.disk_kind.map(|kind| {
471
match kind {
472
473
// Trees are never tracked for rewrites, so we 'pretend'.
474
gix_object::tree::EntryKind::Tree
475
@@ -507,7 +507,7 @@ pub(super) mod function {
507
};
508
509
Ok(match kind {
510
511
// Go along with unreadable files, they are passed along without rename tracking.
512
return Ok(object_hash.null());
513
0 commit comments