Add staged files (so random files don't get removed)

This commit is contained in:
2026-03-03 11:16:22 +00:00
parent c0a71bc285
commit 399a72f380
5 changed files with 141 additions and 28 deletions

View File

@@ -5,6 +5,7 @@ use std::path::PathBuf;
pub enum CommitError {
NotADescendantOfCurrentDir(PathBuf),
InsideTourDir(PathBuf),
NothingToCommit,
Io(io::Error),
}
@@ -17,6 +18,9 @@ impl std::fmt::Display for CommitError {
Self::InsideTourDir(path) => {
write!(f, "File {:?} is inside a .tour directory, which is not allowed.", path)
}
Self::NothingToCommit => {
write!(f, "Nothing to commit. Use `tour add <files>` to stage files first.")
}
Self::Io(e) => write!(f, "IO error: {}", e),
}
}