nikivdev/code · error
working tree has uncommitted changes; commit/stash them or r
Error message
working tree has uncommitted changes; commit/stash them or rerun with --stash
What it means
Error "working tree has uncommitted changes; commit/stash them or rerun with --stash" thrown in nikivdev/code.
Source
Thrown at src/fix.rs:250
let root = String::from_utf8_lossy(&output.stdout).trim().to_string();
if root.is_empty() {
bail!("failed to resolve git repository root");
}
Ok(std::path::PathBuf::from(root))
}
fn ensure_clean_or_stash(
repo_root: &std::path::Path,
allow_stash: bool,
stashed: &mut bool,
) -> Result<()> {
let status = git_output(repo_root, &["status", "--porcelain"])?;
if status.trim().is_empty() {
return Ok(());
}
if !allow_stash {
bail!("working tree has uncommitted changes; commit/stash them or rerun with --stash");
}
println!("Stashing local changes...");
git_status(
repo_root,
&["stash", "push", "-u", "-m", "f fix auto-stash"],
)?;
*stashed = true;
Ok(())
}
fn ensure_has_parent_commit(repo_root: &std::path::Path) -> Result<()> {
let output = Command::new("git")
.args(["rev-parse", "HEAD~1"])
.current_dir(repo_root)
.output()
.context("failed to check git history")?;
if !output.status.success() {View on GitHub (pinned to a747e741ae)
When it happens
Trigger: Thrown at src/fix.rs:250 when the library encounters an invalid state.
Common situations: See trigger scenarios.
AI-assisted analysis of nikivdev/code@a747e741ae (2026-09-01).
Data as JSON: /api/errors/7b4fbbaf438fa113.
Report an issue: GitHub.