{"record":{"id":"77e24c5771785cf5","repo":"xai-org/grok-build","slug":"not-a-git-repository-or-worktree","errorCode":null,"errorMessage":"Not a git repository or worktree","messagePattern":"Not a git repository or worktree","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"crates/codegen/xai-grok-workspace/src/worktree/mod.rs","lineNumber":1019,"sourceCode":"            .await\n            .unwrap_or_default();\n        return PrepareWorktreeResult {\n            response: Ok(CreateWorktreeResponse::Exists {\n                session_id: req.session_id.clone(),\n                worktree_path,\n                commit,\n                source_git_root,\n            }),\n            spawn_task: false,\n        };\n    }\n\n    if git_cli(source_path, &[\"rev-parse\", \"--git-dir\"])\n        .await\n        .is_err()\n    {\n        return PrepareWorktreeResult {\n            response: Err(anyhow::anyhow!(\"Not a git repository or worktree\")),\n            spawn_task: false,\n        };\n    }\n\n    // Don't set the marker here: in proxy mode the shell never spawns\n    // `create_worktree_async`, so a marker set here would never clear and would wedge\n    // every retry in `Creating`. The async entrypoint owns it; `prepare` only reads it.\n    PrepareWorktreeResult {\n        response: Ok(CreateWorktreeResponse::Creating {\n            session_id: req.session_id.clone(),\n            worktree_path,\n            source_git_root,\n        }),\n        spawn_task: true,\n    }\n}\n\npub async fn create_worktree_async<N: WorktreeNotificationSender + Clone + 'static>(","sourceCodeStart":1001,"sourceCodeEnd":1037,"githubUrl":"https://github.com/xai-org/grok-build/blob/bc7f02eddd3d84085849dc19ed216f11c23b0571/crates/codegen/xai-grok-workspace/src/worktree/mod.rs#L1001-L1037","documentation":"Error \"Not a git repository or worktree\" thrown in xai-org/grok-build.","triggerScenarios":"Thrown at crates/codegen/xai-grok-workspace/src/worktree/mod.rs:1019 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":"bc7f02eddd3d84085849dc19ed216f11c23b0571","analyzedAt":"2026-08-31T04:59:42.031Z","schemaVersion":2},"datasetVersion":"2026-08-31T09:17:48.483Z"}