Add helper function on RepoStatus to check clean state
This commit is contained in:
11
src/repo.rs
11
src/repo.rs
@@ -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::*;
|
||||
|
||||
Reference in New Issue
Block a user