MCPcopy Create free account
hub / github.com/f0rr0/oliphaunt / check_source_free_repo

Function check_source_free_repo

xtask/src/main.rs:5408–5431  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

5406}
5407
5408fn 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
5433fn is_release_staged_workspace() -> bool {
5434 env::var_os("PGLITE_OXIDE_RELEASE_STAGED").as_deref() == Some(std::ffi::OsStr::new("1"))

Callers 3

assetsFunction · 0.85
verify_committed_assetsFunction · 0.85
check_source_spineFunction · 0.85

Calls 2

command_outputFunction · 0.85

Tested by

no test coverage detected