Enhance syncback functionality to manage .gitkeep files

- Updated the syncback loop to skip hidden files/directories, with an exception for .gitkeep, which is necessary for directory management.
- Added comprehensive tests to ensure proper cleanup of stale .gitkeep files in various scenarios, including non-empty directories and init-style projects.
This commit is contained in:
Joe 2026-02-08 16:23:41 -06:00
parent 9b832c4637
commit 7172ae2d09
2 changed files with 120 additions and 2 deletions

View file

@ -381,9 +381,11 @@ pub fn syncback_loop_with_stats(
continue;
}
// Skip hidden files/directories (starting with .)
// Skip hidden files/directories (starting with .), except
// .gitkeep which is managed by Rojo and must be tracked for
// cleanup when directories are no longer empty.
if let Some(name) = path.file_name().and_then(|n| n.to_str()) {
if name.starts_with('.') {
if name.starts_with('.') && name != ".gitkeep" {
log::trace!("Skipping {} (hidden)", path.display());
continue;
}