nikivdev/code · error

cannot unroll: repository has no parent commit

Error message

cannot unroll: repository has no parent commit

What it means

Error "cannot unroll: repository has no parent commit" thrown in nikivdev/code.

Source

Thrown at src/fix.rs:269

    }

    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() {
        bail!("cannot unroll: repository has no parent commit");
    }
    Ok(())
}

fn git_output(repo_root: &std::path::Path, args: &[&str]) -> Result<String> {
    let output = Command::new("git")
        .args(args)
        .current_dir(repo_root)
        .output()
        .with_context(|| format!("failed to run git {}", args.join(" ")))?;
    if !output.status.success() {
        let stderr = String::from_utf8_lossy(&output.stderr);
        bail!("git {} failed: {}", args.join(" "), stderr.trim());
    }
    Ok(String::from_utf8_lossy(&output.stdout).to_string())
}

fn git_status(repo_root: &std::path::Path, args: &[&str]) -> Result<()> {

View on GitHub (pinned to a747e741ae)

When it happens

Trigger: Thrown at src/fix.rs:269 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/a5321ea54993b53b. Report an issue: GitHub.