1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
mod add;
mod commit;
mod flag;
mod push;
mod status;

pub use add::Add;
use anyhow::Result;
pub use commit::Commit;
pub use flag::Flag;
pub use push::Push;
pub use status::Status;
use std::process::Stdio;

/// Determine whether there are uncommitted changes.
pub fn is_dirty() -> Result<bool> {
  let output = Status::new().stdout(Stdio::piped()).output()?;

  if output.stdout.is_empty() {
    Ok(false)
  } else {
    Ok(true)
  }
}