()
| 5406 | } |
| 5407 | |
| 5408 | fn check_source_free_repo() -> Result<()> { |
| 5409 | if Path::new(".gitmodules").exists() { |
| 5410 | bail!("tracked upstream source checkouts are not allowed: remove .gitmodules"); |
| 5411 | } |
| 5412 | if is_release_staged_workspace() && !Path::new(".git").exists() { |
| 5413 | return Ok(()); |
| 5414 | } |
| 5415 | for path in [ |
| 5416 | "assets/checkouts", |
| 5417 | "assets/wasix-build/build", |
| 5418 | "assets/wasix-build/work", |
| 5419 | GENERATED_ASSETS_DIR, |
| 5420 | RELEASE_STAGE_DIR, |
| 5421 | ] { |
| 5422 | let tracked = command_output("git", &["ls-files", path], Path::new("."))?; |
| 5423 | if !tracked.trim().is_empty() { |
| 5424 | bail!( |
| 5425 | "{path} contains tracked generated/source checkout files:\n{}", |
| 5426 | tracked.trim() |
| 5427 | ); |
| 5428 | } |
| 5429 | } |
| 5430 | Ok(()) |
| 5431 | } |
| 5432 | |
| 5433 | fn is_release_staged_workspace() -> bool { |
| 5434 | env::var_os("PGLITE_OXIDE_RELEASE_STAGED").as_deref() == Some(std::ffi::OsStr::new("1")) |
no test coverage detected