Skip to content

Commit b59b828

Browse files
committed
fix: only delete manifest when full tracked set was processed
When remove_tracked_files is called with an explicit files dict (subset), skip manifest deletion to avoid losing tracking of entries not in the subset. Manifest cleanup only runs when the full set is read from the manifest itself (files=None).
1 parent 38ae759 commit b59b828

File tree

1 file changed

+6
-5
lines changed

1 file changed

+6
-5
lines changed

src/specify_cli/agent_pack.py

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -695,11 +695,12 @@ def remove_tracked_files(
695695
abs_path.unlink()
696696
removed.append(rel_path)
697697

698-
# Clean up the install manifest only when no tracked files remain
699-
# on disk. Files already deleted by the user count as gone, not
700-
# as "remaining" — only files that still exist and were skipped
701-
# (e.g. modified without --force) prevent manifest cleanup.
702-
if manifest_file.is_file():
698+
# Clean up the install manifest only when the full tracked set was
699+
# processed (i.e. read from the manifest itself). When an explicit
700+
# ``files`` dict is provided the caller may be passing a subset
701+
# (e.g. only agent_files), so deleting the manifest could lose
702+
# tracking of entries not in the subset.
703+
if files is None and manifest_file.is_file():
703704
still_on_disk = sum(
704705
1 for rel_path in entries
705706
if (project_path / rel_path).is_file()

0 commit comments

Comments
 (0)