Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix File System Merging Problems #4205

Merged
merged 2 commits into from
Sep 6, 2023
Merged

Fix File System Merging Problems #4205

merged 2 commits into from
Sep 6, 2023

Conversation

theduke
Copy link
Contributor

@theduke theduke commented Sep 5, 2023

fix: Prevent invalid file system merging errors

This commit changes the EmptyFileSystem read_dir() and metadata() implementation
to always return an empty stub when trying to read the root path "/".

This is done because some code paths expect the root to always be
readable.

This also makes sense thematically, because an empty file system should
still be readable, just not contain any files.

This fixes bugs related to file system union/merging logic.

Also adds a regression test.

@theduke theduke requested a review from ptitSeb September 5, 2023 16:20
This commit changes the EmptyFileSystem read_dir() implementation to
always return an empty iterator when trying to read the root path "/".

This is done because some code paths expect the root to always be
readable.

This also makes sense theoretically, because an empty file system should
still be readable, just not contain any files.
@theduke theduke force-pushed the fix-filesystem-merging branch from 88d785c to 7768ed7 Compare September 5, 2023 16:31
@theduke theduke closed this Sep 6, 2023
@theduke theduke reopened this Sep 6, 2023
Tests merging as done in the `Console`.
@theduke theduke force-pushed the fix-filesystem-merging branch from 7768ed7 to 6f0b022 Compare September 6, 2023 07:18
@theduke theduke enabled auto-merge (rebase) September 6, 2023 07:51
@theduke theduke merged commit 7d14d61 into master Sep 6, 2023
@theduke theduke deleted the fix-filesystem-merging branch September 6, 2023 08:13
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.

2 participants