Add batch script files and enhance git staging logic

- Introduced 20 new batch script files (BatchScript01.luau to BatchScript20.luau) for testing purposes.
- Enhanced the `change_processor` to consolidate git staging operations, reducing the risk of index.lock races by batching paths for staging.
- Updated the `PatchSet` struct to include a new field for pre-resolved filesystem paths to stage via git add.
- Modified the API to handle batch staging more efficiently, ensuring all files are staged correctly in mixed write scenarios.

These changes improve the testing framework and optimize git integration for batch operations.
This commit is contained in:
Joe 2026-02-17 21:27:10 -06:00
parent bb4d40c4d3
commit 6de088be31
24 changed files with 272 additions and 13 deletions

View file

@ -24,6 +24,12 @@ pub struct PatchSet {
/// Populated from WriteRequest.stage_ids, consumed by change_processor.
#[serde(default, skip)]
pub stage_ids: HashSet<Ref>,
/// Pre-resolved filesystem paths to stage via git add.
/// Populated by api.rs (for files already on disk), consumed by change_processor
/// together with any Source write paths from stage_ids.
/// All staging is consolidated into a single git_add call to avoid index.lock races.
#[serde(default, skip)]
pub stage_paths: Vec<std::path::PathBuf>,
}
impl PatchSet {
@ -33,6 +39,7 @@ impl PatchSet {
added_instances: Vec::new(),
updated_instances: Vec::new(),
stage_ids: HashSet::new(),
stage_paths: Vec::new(),
}
}
}