1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
//! Lightweight git status check via shell-out.
//!
//! `apply` uses this to decide whether to escalate `AutoAbsorb` to
//! `NeedsConfirm` when `[absorb] require_clean_git = true` — pulling
//! target-side edits into a dirty source repo would mix yui's writes
//! with the user's in-progress changes in a single commit.
//!
//! No git crate dependency: shells out to the `git` CLI. If `git` isn't
//! installed or the directory isn't a repo, callers receive a clear
//! `Error::Git` and can decide how lenient to be.
use Command;
use Utf8Path;
use crate::;
/// Returns `true` when the working tree at `repo` has no uncommitted
/// changes and no untracked files (i.e. `git status --porcelain` is
/// empty). `Err(Error::Git(_))` if `git` isn't on `$PATH` or `repo`
/// isn't a repository.