{"record":{"id":"c767c39f21d07c78","repo":"nikivdev/code","slug":"jj-git-root-returned-an-empty-path","errorCode":null,"errorMessage":"jj git root returned an empty path","messagePattern":"jj git root returned an empty path","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"src/jj.rs","lineNumber":203,"sourceCode":"    let resolved = if path.is_absolute() {\n        path.to_path_buf()\n    } else {\n        std::env::current_dir()\n            .context(\"failed to read current dir\")?\n            .join(path)\n    };\n    Ok(resolved.canonicalize().unwrap_or(resolved))\n}\n\nfn repo_root_for_workspace(workspace_root: &Path) -> Result<PathBuf> {\n    let git_root = jj_read_in(workspace_root, &[\"git\", \"root\"])?;\n    repo_root_from_git_root(git_root.trim()).map(PathBuf::from)\n}\n\nfn repo_root_from_git_root(git_root: &str) -> Result<&str> {\n    let trimmed = git_root.trim();\n    if trimmed.is_empty() {\n        bail!(\"jj git root returned an empty path\");\n    }\n    if let Some(parent) = trimmed.strip_suffix(\"/.git\") {\n        return Ok(parent);\n    }\n    if let Some(parent) = trimmed.strip_suffix(\"\\\\.git\") {\n        return Ok(parent);\n    }\n    Ok(trimmed)\n}\n\nfn run_status(opts: JjStatusOpts) -> Result<()> {\n    let workspace_root = vcs::ensure_jj_repo()?;\n    let ctx = JjContext {\n        repo_root: repo_root_for_workspace(&workspace_root)?,\n        workspace_root,\n    };\n    if opts.raw {\n        return jj_run_in(&ctx.workspace_root, &[\"status\"]);","sourceCodeStart":185,"sourceCodeEnd":221,"githubUrl":"https://github.com/nikivdev/code/blob/a747e741ae92c09071d0ae946ab48488adcff1ce/src/jj.rs#L185-L221","documentation":"Error \"jj git root returned an empty path\" thrown in nikivdev/code.","triggerScenarios":"Thrown at src/jj.rs:203 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"}