Commit d933282
cache_metadata: Fix parent directory handling for bare filenames
When a bare filename like "disk.img" is passed to bcvk to-disk,
path.parent() returns Some("") (empty string) instead of None.
This caused Dir::open_ambient_dir() to fail with "No such file or
directory" when trying to open an empty path.
The fix filters out empty parent paths and defaults to "." (current
directory) for bare filenames, while preserving existing behavior
for relative and absolute paths.
Fixes both check_cached_disk() and read_image_digest_from_path().
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Assisted-by: Claude Code (Sonnet 4.5)
Co-Authored-By: Claude <[email protected]>
Signed-off-by: Wei Shi <[email protected]>1 parent 7022bd9 commit d933282
1 file changed
+6
-2
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
123 | 123 | | |
124 | 124 | | |
125 | 125 | | |
| 126 | + | |
126 | 127 | | |
127 | 128 | | |
128 | | - | |
| 129 | + | |
| 130 | + | |
129 | 131 | | |
130 | 132 | | |
131 | 133 | | |
| |||
191 | 193 | | |
192 | 194 | | |
193 | 195 | | |
| 196 | + | |
194 | 197 | | |
195 | 198 | | |
196 | | - | |
| 199 | + | |
| 200 | + | |
197 | 201 | | |
198 | 202 | | |
199 | 203 | | |
| |||
0 commit comments