Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

mv: gnu test case part-hardlink fix #6632

Draft
wants to merge 9 commits into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 4 additions & 0 deletions src/uu/mv/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -20,13 +20,17 @@ path = "src/mv.rs"
clap = { workspace = true }
fs_extra = { workspace = true }
indicatif = { workspace = true }
walkdir = { workspace = true }
uucore = { workspace = true, features = [
"backup-control",
"fs",
"fsxattr",
"update-control",
] }

[dev-dependencies]
tempfile = { workspace = true }

[[bin]]
name = "mv"
path = "src/main.rs"
16 changes: 16 additions & 0 deletions src/uu/mv/src/error.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@

use uucore::error::UError;

use fs_extra::error::Error as FsXError;

#[derive(Debug)]
pub enum MvError {
NoSuchFile(String),
Expand All @@ -19,6 +21,8 @@
NotADirectory(String),
TargetNotADirectory(String),
FailedToAccessNotADirectory(String),
FsXError(FsXError),

Check warning on line 24 in src/uu/mv/src/error.rs

View check run for this annotation

Codecov / codecov/patch

src/uu/mv/src/error.rs#L24

Added line #L24 was not covered by tests
NotAllFilesMoved,
}

impl Error for MvError {}
Expand Down Expand Up @@ -49,6 +53,18 @@
Self::FailedToAccessNotADirectory(t) => {
write!(f, "failed to access {t}: Not a directory")
}
Self::FsXError(err) => {
write!(f, "{err}")

Check warning on line 57 in src/uu/mv/src/error.rs

View check run for this annotation

Codecov / codecov/patch

src/uu/mv/src/error.rs#L56-L57

Added lines #L56 - L57 were not covered by tests
}
Self::NotAllFilesMoved => {
write!(f, "failed to move all files")

Check warning on line 60 in src/uu/mv/src/error.rs

View check run for this annotation

Codecov / codecov/patch

src/uu/mv/src/error.rs#L60

Added line #L60 was not covered by tests
}
}
}
}

impl From<FsXError> for MvError {
fn from(err: FsXError) -> Self {
Self::FsXError(err)
}

Check warning on line 69 in src/uu/mv/src/error.rs

View check run for this annotation

Codecov / codecov/patch

src/uu/mv/src/error.rs#L67-L69

Added lines #L67 - L69 were not covered by tests
}
Loading
Loading