pub fn add_globs(&mut self, globs: &[&str], applies_in: Option<&PathBuf>) -> Result<(), Error> {
		let virtual_ignore_file = IgnoreFile {
			path: "manual glob".into(),
			applies_in: applies_in.cloned(),
			applies_to: None,
		};
		let applies_in = get_applies_in_path(&self.origin, &virtual_ignore_file);
		let applies_in_str = applies_in.display().to_string();

		if self.ignores.get(&applies_in_str).is_none() {
			self.ignores.insert(
				applies_in_str.clone(),
				Ignore {
					gitignore: Gitignore::empty(),
					builder: Some(GitignoreBuilder::new(&applies_in)),
				},
			);
		}

		let Some(Ignore {
			builder: Some(builder),
			..
		}) = self.ignores.get_mut(&applies_in_str)
		else {
			return Ok(());
		};

		let _span = trace_span!("loading ignore globs", ?globs).entered();
		for line in globs {
			if line.is_empty() || line.starts_with('#') {
				continue;
			}

			trace!(?line, "adding ignore line");
			builder
				.add_line(Some(applies_in.clone()), line)
				.map_err(|err| Error::Glob { file: None, err })?;
		}

		self.recompile(&virtual_ignore_file)?;

		Ok(())
	}
Adds some globs manually, if the builder is available.

Does nothing silently otherwise.
crates/ignore-files/src/filter.rs