You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Browse filesBrowse the repository at this point in the historyBrowse files
Peter J McDade
committed
stacked_table: skip non-segment file names in heads/
Foreign files like AppleDouble `._*` (which appear when a macOS-created
archive is extracted on another system) or `.DS_Store` landing in
store/extra/heads made every metadata read fail until removed by hand;
a non-UTF8 name panicked outright. gc() already tolerates foreign
names in the table directory, and SimpleOpHeadsStore::get_op_heads
tolerates non-hex UTF-8 names in its own heads directory (though it
still errors on non-UTF8 ones). Apply the same idea to
get_head_tables(): ignore any entry whose name isn't exactly
SEGMENT_FILE_NAME_LENGTH ASCII hex characters, logging each skip at
warn level (visible under --debug/JJ_LOG), and never touch the
foreign file itself.
If every entry in heads/ turns out to be invalid, return the new
TableStoreError::NoValidHeads instead of silently manufacturing a
fresh empty table, which would otherwise mask lost head metadata. A
genuinely empty heads/ (no entries at all) keeps its existing
behavior.
Fixes#9775
Assisted-by: Claude:claude-fable-5
0 commit comments