{"record":{"id":"6e06cb28cddb3c63","repo":"zed-industries/zed","slug":"git-worktree-directory-must-not-be-use-s","errorCode":null,"errorMessage":"git.worktree_directory must not be \"..\" (use \"../some-name\" instead)","messagePattern":"git\\.worktree_directory must not be \"\\.\\.\" \\(use \"\\.\\./some-name\" instead\\)","errorType":"validation","errorClass":"anyhow::Error","httpStatus":null,"severity":"error","filePath":"crates/project/src/git_store.rs","lineNumber":10521,"sourceCode":"                            cursor.seek_forward(&PathTarget::Path(path), Bias::Left);\n                            while let Some(entry) = cursor.item() {\n                                if !entry.repo_path.starts_with(path) {\n                                    break;\n                                }\n\n                                if !current_status_paths.contains(&entry.repo_path) {\n                                    changed_path_statuses.push(Edit::Remove(PathKey(\n                                        entry.repo_path.as_ref().clone(),\n                                    )));\n                                }\n                                cursor.next();\n                            }\n                        }\n\n                        let mut cursor = prev_statuses.cursor::<PathProgress>(());\n\n                        for (repo_path, status) in &*statuses.entries {\n                            let current_diff_stat = diff_stats.get(repo_path).copied();\n                            let current_staged_diff_stat =\n                                staged_diff_stats.get(repo_path).copied();\n                            let current_unstaged_diff_stat =\n                                unstaged_diff_stats.get(repo_path).copied();\n\n                            if cursor.seek_forward(&PathTarget::Path(repo_path), Bias::Left)\n                                && cursor.item().is_some_and(|entry| {\n                                    entry.status == *status\n                                        && entry.diff_stat == current_diff_stat\n                                        && entry.staged_diff_stat == current_staged_diff_stat\n                                        && entry.unstaged_diff_stat == current_unstaged_diff_stat\n                                })\n                            {\n                                continue;\n                            }\n\n                            changed_path_statuses.push(Edit::Insert(StatusEntry {\n                                repo_path: repo_path.clone(),","sourceCodeStart":10503,"sourceCodeEnd":10539,"githubUrl":"https://github.com/zed-industries/zed/blob/916fc2b8cb3a815cbef4a3b40e13081be72036b6/crates/project/src/git_store.rs#L10503-L10539","documentation":"After trimming trailing separators, a worktree_directory value equal to exactly \"..\" would resolve the worktree directory to the repository's parent directory itself, colliding with the repo's own directory (crates/project/src/git_store.rs:10503). Zed rejects it and asks for a named sibling like \"../some-name\" instead.","triggerScenarios":"Setting git.worktree_directory to \"..\", or values that reduce to it after trimming trailing separators, such as \"../\" or \"..\\\\\".","commonSituations":"Users trying to scatter worktrees directly in the folder that contains their repos, without a naming prefix.","solutions":["Use a named sibling directory: \"../my-repo-worktrees\"","Or keep worktrees inside the repository: \".worktrees\""],"exampleFix":"// settings.json - before\n{ \"git\": { \"worktree_directory\": \"..\" } }\n\n// settings.json - after\n{ \"git\": { \"worktree_directory\": \"../acme-worktrees\" } }","handlingStrategy":"validation","validationCode":"let trimmed = setting.trim_end_matches(['/', '\\\\']);\nif trimmed == \"..\" {\n    return Err(\"git.worktree_directory must not be \\\"..\\\" (use \\\"../some-name\\\" instead)\".into());\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Always name worktree directories (\"../repo-worktrees\"), never a bare parent reference","Mirror Zed's trailing-separator trimming when pre-validating configs"],"tags":["git","worktree","settings","configuration","path-validation"],"backgroundTag":"invalid-config-value","analyzedSha":"916fc2b8cb3a815cbef4a3b40e13081be72036b6","analyzedAt":"2026-08-20T19:29:52.058Z","contentChangedAt":"2026-08-20T19:29:52.058Z","schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}