diff --git a/crates/bough-cli/src/config.rs b/crates/bough-cli/src/config.rs index c5c234a0..9a9d19f2 100644 --- a/crates/bough-cli/src/config.rs +++ b/crates/bough-cli/src/config.rs @@ -524,6 +524,7 @@ exclude = [] } // cli[verify config.lang.exclude.bough-dir] + // cli[verify config.lang.exclude.from-vcs-ignore] #[test] fn lang_exclude_globs_includes_bough_dir() { let cli = parse_ok(&["run"], MINIMAL_TOML); diff --git a/crates/bough-core/src/workspace.rs b/crates/bough-core/src/workspace.rs index eef99193..d31a98b9 100644 --- a/crates/bough-core/src/workspace.rs +++ b/crates/bough-core/src/workspace.rs @@ -225,6 +225,7 @@ impl<'a> Workspace<'a> { } // core[impl workspace.validate-unchanged] + // core[impl workspace.validate-unchanged.untracked] pub fn validate_unchanged(&self) -> Result<(), Error> { for twig in self.files() { let base_file = File::new(self.base, &twig).resolve(); @@ -381,6 +382,18 @@ mod tests { assert!(ws.validate_unchanged().is_err()); } + // core[verify workspace.validate-unchanged.untracked] + #[test] + fn validate_unchanged_ignores_extra_files() { + let (_base_dir, base) = make_base(); + let ws_dir = tempfile::tempdir().unwrap(); + let ws = Workspace::new(ws_dir.path().to_path_buf(), &base).unwrap(); + std::fs::write(ws.path().join("extra.txt"), "not tracked").unwrap(); + std::fs::create_dir_all(ws.path().join("other")).unwrap(); + std::fs::write(ws.path().join("other/file.js"), "also not tracked").unwrap(); + ws.validate_unchanged().unwrap(); + } + // core[verify workspace.bind.validate-unchanged] #[test] fn bind_validates_unchanged_on_creation() {