Skip to content

fix: prune nested metadata directories during import and export#60

Merged
guodong-sq merged 1 commit intomainfrom
guodong/prune-nested-metadata
Mar 29, 2026
Merged

fix: prune nested metadata directories during import and export#60
guodong-sq merged 1 commit intomainfrom
guodong/prune-nested-metadata

Conversation

@guodong-sq
Copy link
Copy Markdown
Collaborator

Summary

  • Metadata import was redundantly copying nested metadata directories (e.g., .idea inside .ijwb) because it processed each pattern independently with find -L, which followed vault symlinks into parent metadata dirs
  • Extracts the prune algorithm into a shared _wt_prune_nested_paths() function in lib/wt-common
  • Rewires wt-metadata-export, wt-metadata-import, and _wt_detect_metadata_patterns in wt-context-setup to use the shared function

Test plan

  • 5 new unit tests for _wt_prune_nested_paths (empty, single, siblings, nested, multi-level)
  • 1 new integration test verifying nested .idea inside .ijwb is not imported separately
  • All 326 existing tests pass

🤖 Generated with Claude Code

Metadata import was redundantly copying nested metadata directories
(e.g., .idea inside .ijwb) because it processed each pattern
independently with `find -L`, which followed vault symlinks into
parent metadata dirs.

Extract the prune algorithm into a shared `_wt_prune_nested_paths()`
function in lib/wt-common. Rewire export, import, and context-setup
to use it instead of inline dedup/prune logic.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@guodong-sq guodong-sq merged commit 7b12f55 into main Mar 29, 2026
5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant