{"record":{"id":"a01c8e5185e3e479","repo":"zed-industries/zed","slug":"git-worktree-directory-must-not-be-empty","errorCode":null,"errorMessage":"git.worktree_directory must not be empty","messagePattern":"git\\.worktree_directory must not be empty","errorType":"validation","errorClass":"anyhow::Error","httpStatus":null,"severity":"error","filePath":"crates/project/src/git_store.rs","lineNumber":10516,"sourceCode":"                            .map(|(repo_path, _)| repo_path.clone())\n                            .collect::<BTreeSet<_>>();\n\n                        for path in &changed_paths {\n                            let mut cursor = prev_statuses.cursor::<PathProgress>(());\n                            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                            {","sourceCodeStart":10498,"sourceCodeEnd":10534,"githubUrl":"https://github.com/zed-industries/zed/blob/916fc2b8cb3a815cbef4a3b40e13081be72036b6/crates/project/src/git_store.rs#L10498-L10534","documentation":"The same worktree-directory validator rejects an empty value (crates/project/src/git_store.rs:10498). git.worktree_directory must be a non-empty relative path; an empty string gives Zed nothing to join onto the repository anchor and is refused before any worktree is created.","triggerScenarios":"Setting \"git\": { \"worktree_directory\": \"\" } in settings.json and creating a worktree. Note that \"///\" does not reach this check - it is caught earlier as an absolute path.","commonSituations":"Explicitly blanking the setting hoping to restore the default; settings templating that renders an empty value; user error.","solutions":["Remove the git.worktree_directory key from settings.json to get the default","Set an explicit non-empty relative path such as \".zed-worktrees\" or \"../worktrees\""],"exampleFix":"// settings.json - before\n{ \"git\": { \"worktree_directory\": \"\" } }\n\n// settings.json - after\n{ \"git\": { \"worktree_directory\": \".zed-worktrees\" } }","handlingStrategy":"validation","validationCode":"if worktree_directory_setting.is_empty() {\n    return Err(\"git.worktree_directory must not be empty\".into());\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Omit the key entirely to use the default instead of setting an empty string","Lint settings files for empty-string values on path keys"],"tags":["git","worktree","settings","configuration","empty-value"],"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"}