Add helper function on RepoStatus to check clean state

This commit is contained in:
2021-12-29 18:43:14 +01:00
parent 717b0d3a74
commit c0168c3650

View File

@@ -253,6 +253,17 @@ impl Worktree {
}
}
impl RepoStatus {
fn clean(&self) -> bool {
match &self.changes {
None => true,
Some(changes) => {
changes.files_new == 0 && changes.files_deleted == 0 && changes.files_modified == 0
}
}
}
}
#[cfg(test)]
mod tests {
use super::*;