#![feature(type_alias_impl_trait)]
#![feature(impl_trait_in_assoc_type)]
#![warn(missing_docs, rust_2018_idioms)]
pub mod coordination;
pub mod error;
pub mod file_ops;
pub mod git;
pub mod http;
pub mod interner;
pub mod output;
pub mod patterns;
pub mod platform;
pub mod traits;
pub mod types;
pub use error::{Error, Result};
pub use interner::StringInterner;
pub use types::{
ChangeType, ChangedFile, CiDecision, DiffResult, FailureTrackingLevel, GroupDeployAction,
GroupDeployDecision, GroupDeployReason, InputConfig, InternedString, ProcessedResult,
};
pub async fn detect_changes(config: InputConfig<'_>) -> Result<ProcessedResult> {
let interner = StringInterner::with_capacity(2048);
let repo = git::repository::GitRepository::discover(".")?;
if config.fetch_depth > 0 {
repo.ensure_depth(config.fetch_depth).await?;
}
let processor = coordination::processor::FileProcessor::new(&repo, &interner, &config);
let result = processor.process().await?;
Ok(result)
}
pub fn detect_changes_sync(config: InputConfig<'_>) -> Result<ProcessedResult> {
tokio::runtime::Runtime::new()
.map_err(|e| Error::Runtime(e.to_string()))?
.block_on(detect_changes(config))
}
#[cfg(test)]
mod tests {
#[test]
fn test_library_version() {
let _ = env!("CARGO_PKG_VERSION");
}
}