Implement tree reconciliation toggle and enhance git functionality

- Introduced a constant to enable or disable periodic tree reconciliation after VFS events, addressing a persistent drift bug that caused infinite re-snapshot loops on large projects.
- Updated the `ChangeProcessor` to conditionally execute tree reconciliation based on the new constant, improving performance during file modifications.
- Enhanced the git module by adding new functions for shallow cloning and checking if files are staged, streamlining git operations.
- Refactored the `InitCommand` to utilize the new git functions for repository initialization and cloning, improving clarity and reducing redundancy.

These changes aim to optimize file change handling and enhance git integration within the project.
This commit is contained in:
Joe 2026-03-01 18:16:03 -06:00
parent 1a03554ee8
commit 76b5d8bc75
7 changed files with 248 additions and 373 deletions

View file

@ -202,11 +202,7 @@ impl TestServeSession {
copy_recursive(&source_path, &project_path)
.expect("Couldn't copy project to temporary directory");
// Initialize git repo and persist config to disk so that
// git_add_all_and_commit (which opens a fresh gix handle via
// gix::discover) can read user identity. The gix SnapshotMut
// API is in-memory only and never writes to .git/config.
gix::init(&project_path).expect("gix init failed");
librojo::git::git_init_repo(&project_path).expect("git init failed");
fs::write(
project_path.join(".git/config"),
"[user]\n\tname = Test\n\temail = test@test.com\n[core]\n\tautocrlf = false\n",