{"record":{"id":"0879598e46c38a28","repo":"clockworklabs/SpacetimeDB","slug":"failed-to-execute-git-ls-files","errorCode":null,"errorMessage":"Failed to execute git ls-files","messagePattern":"Failed to execute git ls-files","errorType":"panic","errorClass":null,"httpStatus":null,"severity":"error","filePath":"crates/cli/build.rs","lineNumber":411,"sourceCode":"        })\n}\n\nfn get_git_tracked_files_via_cli(path: &Path, manifest_dir: &Path) -> (Vec<PathBuf>, PathBuf) {\n    let repo_root = get_repo_root();\n    let repo_root = repo_root.canonicalize().unwrap_or_else(|err| {\n        panic!(\n            \"Failed to canonicalize repo_root path {}: {err:#?}\",\n            repo_root.display(),\n        )\n    });\n\n    let resolved_path = make_repo_root_relative(&get_full_path_within_manifest_dir(path, manifest_dir), &repo_root);\n\n    let output = Command::new(\"git\")\n        .args([\"ls-files\", resolved_path.to_str().unwrap()])\n        .current_dir(repo_root)\n        .output()\n        .expect(\"Failed to execute git ls-files\");\n\n    if !output.status.success() {\n        return (Vec::new(), resolved_path);\n    }\n\n    let stdout = String::from_utf8(output.stdout).unwrap();\n    let files: Vec<PathBuf> = stdout\n        .lines()\n        .filter(|line| !line.is_empty())\n        .map(PathBuf::from)\n        .collect();\n\n    (files, resolved_path)\n}\n\nfn get_repo_root() -> PathBuf {\n    let manifest_dir = get_manifest_dir();\n    // Cargo doesn't expose a way to get the workspace root, AFAICT (pgoldman 2025-10-31).","sourceCodeStart":393,"sourceCodeEnd":429,"githubUrl":"https://github.com/clockworklabs/SpacetimeDB/blob/524b4487d949b61a07d4f39c862d1290259dfd20/crates/cli/build.rs#L393-L429","documentation":"Error \"Failed to execute git ls-files\" thrown in clockworklabs/SpacetimeDB.","triggerScenarios":"Thrown at crates/cli/build.rs:411 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":"524b4487d949b61a07d4f39c862d1290259dfd20","analyzedAt":"2026-08-16T23:58:54.611Z","schemaVersion":2},"datasetVersion":"2026-08-17T04:17:16.089Z"}