{"record":{"id":"ddbbb90b9930a5f9","repo":"nikivdev/code","slug":"git-failed-ddbbb9","errorCode":null,"errorMessage":"git {} failed","messagePattern":"git (.+?) failed","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"src/commit.rs","lineNumber":12351,"sourceCode":"        .with_context(|| format!(\"failed to run git {}\", args.join(\" \")))?;\n\n    if !status.success() {\n        bail!(\"git {} failed with status {}\", args.join(\" \"), status);\n    }\n    Ok(())\n}\n\n/// Try to run a git command, returning Ok/Err without bailing.\nfn git_try(args: &[&str]) -> Result<()> {\n    let status = Command::new(\"git\")\n        .args(args)\n        .stdout(Stdio::null())\n        .stderr(Stdio::null())\n        .status()\n        .with_context(|| format!(\"failed to run git {}\", args.join(\" \")))?;\n\n    if !status.success() {\n        bail!(\"git {} failed\", args.join(\" \"));\n    }\n    Ok(())\n}\n\n/// Push result indicating success, remote ahead, or no remote repo.\nenum PushResult {\n    Success,\n    RemoteAhead,\n    NoRemoteRepo,\n}\n\nfn branch_is_detached(branch: &str) -> bool {\n    let trimmed = branch.trim();\n    trimmed.is_empty() || trimmed == \"HEAD\"\n}\n\nfn git_push_args<'a>(remote: &'a str, branch: &'a str) -> Vec<&'a str> {\n    if branch_is_detached(branch) {","sourceCodeStart":12333,"sourceCodeEnd":12369,"githubUrl":"https://github.com/nikivdev/code/blob/a747e741ae92c09071d0ae946ab48488adcff1ce/src/commit.rs#L12333-L12369","documentation":"Error \"git {} failed\" thrown in nikivdev/code.","triggerScenarios":"Thrown at src/commit.rs:12351 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":[],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"a747e741ae92c09071d0ae946ab48488adcff1ce","analyzedAt":"2026-09-01T22:43:55.719Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-08T10:18:20.063Z"}