| 6090 | } |
| 6091 | |
| 6092 | fn sandbox_upload_plan(local_path: &Path, git_ignore: bool) -> Result<SandboxUploadPlan> { |
| 6093 | let metadata = std::fs::symlink_metadata(local_path).map_err(|err| { |
| 6094 | if err.kind() == ErrorKind::NotFound { |
| 6095 | miette::miette!("local path does not exist: {}", local_path.display()) |
| 6096 | } else { |
| 6097 | miette::miette!( |
| 6098 | "failed to inspect local upload path: {}", |
| 6099 | local_path.display() |
| 6100 | ) |
| 6101 | } |
| 6102 | })?; |
| 6103 | |
| 6104 | if git_ignore |
| 6105 | && !metadata.file_type().is_symlink() |
| 6106 | && let Ok((base_dir, files)) = git_sync_files(local_path) |
| 6107 | { |
| 6108 | if files.is_empty() { |
| 6109 | return Ok(SandboxUploadPlan::GitFilteredEmpty); |
| 6110 | } |
| 6111 | return Ok(SandboxUploadPlan::GitAware { base_dir, files }); |
| 6112 | } |
| 6113 | |
| 6114 | Ok(SandboxUploadPlan::Regular) |
| 6115 | } |
| 6116 | |
| 6117 | fn scrub_git_env(command: &mut Command) -> &mut Command { |
| 6118 | for key in [ |