{"record":{"id":"ce64536c729f6120","repo":"openai/codex","slug":"path-path-must-be-relative-to-the-repository-r","errorCode":null,"errorMessage":"path {path:?} must be relative to the repository root","messagePattern":"path (.+?) must be relative to the repository root","errorType":"exception","errorClass":"GitToolingError","httpStatus":null,"severity":"error","filePath":"codex-rs/git-utils/src/errors.rs","lineNumber":25,"sourceCode":"\n/// Errors returned while managing git worktree snapshots.\n#[derive(Debug, Error)]\npub enum GitToolingError {\n    #[error(\"git command `{command}` failed with status {status}: {stderr}\")]\n    GitCommand {\n        command: String,\n        status: ExitStatus,\n        stderr: String,\n    },\n    #[error(\"git command `{command}` produced non-UTF-8 output\")]\n    GitOutputUtf8 {\n        command: String,\n        #[source]\n        source: FromUtf8Error,\n    },\n    #[error(\"{path:?} is not a git repository\")]\n    NotAGitRepository { path: PathBuf },\n    #[error(\"path {path:?} must be relative to the repository root\")]\n    NonRelativePath { path: PathBuf },\n    #[error(\"path {path:?} escapes the repository root\")]\n    PathEscapesRepository { path: PathBuf },\n    #[error(\"failed to process path inside worktree\")]\n    PathPrefix(#[from] std::path::StripPrefixError),\n    #[error(transparent)]\n    Walkdir(#[from] WalkdirError),\n    #[error(transparent)]\n    Io(#[from] std::io::Error),\n}\n","sourceCodeStart":7,"sourceCodeEnd":36,"githubUrl":"https://github.com/openai/codex/blob/339751715c64496cb86246bfb3935f40e309dd3d/codex-rs/git-utils/src/errors.rs#L7-L36","documentation":"Variant of GitToolingError fired when a path passed to a git operation is absolute or otherwise not relative to the repository root. The API contract requires repo-relative paths; the payload names the offending path.","triggerScenarios":"Thrown at codex-rs/git-utils/src/errors.rs:25 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Convert the path to repo-relative form (strip the repository root prefix) before calling","Reject or canonicalize absolute paths at the call site","Use pathdiff or the repo root handle to compute relative paths consistently"],"exampleFix":null,"handlingStrategy":"validation","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"339751715c64496cb86246bfb3935f40e309dd3d","analyzedAt":"2026-08-25T05:35:09.876Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}