{"record":{"id":"f420f8078148a516","repo":"openai/codex","slug":"path-is-not-a-git-repository","errorCode":null,"errorMessage":"{path:?} is not a git repository","messagePattern":"(.+?) is not a git repository","errorType":"exception","errorClass":"GitToolingError","httpStatus":null,"severity":"error","filePath":"codex-rs/git-utils/src/errors.rs","lineNumber":23,"sourceCode":"use thiserror::Error;\nuse walkdir::Error as WalkdirError;\n\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":5,"sourceCodeEnd":36,"githubUrl":"https://github.com/openai/codex/blob/339751715c64496cb86246bfb3935f40e309dd3d/codex-rs/git-utils/src/errors.rs#L5-L36","documentation":"Variant of GitToolingError fired when the given path does not contain (and is not inside) a git repository — typically no .git directory at or above the path. The caller passed a non-repository path to a git worktree/snapshot operation.","triggerScenarios":"Thrown at codex-rs/git-utils/src/errors.rs:23 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Verify the path points inside an initialized git repository (git rev-parse --is-inside-work-tree)","Initialize the repository with git init if one is expected there","Skip snapshot logic gracefully when the path is intentionally not a repository"],"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"}