fix: keep a path's bytes, so a filename that is not utf-8 survives

This commit is contained in:
2026-09-09 12:01:59 +00:00
parent b4b6d5918f
commit e146b0460a
8 changed files with 172 additions and 72 deletions

View File

@@ -81,11 +81,7 @@ pub fn import(ctx: &Ctx, file: &Path) -> Result<()> {
// a directory cannot be streamed, so it is the one shape that gets copied in
if matches!(dump, Dump::Directory) {
when_ready(
ctx,
&db,
&Cp::into_container(&file.to_string_lossy(), &db.container, &remote),
)?;
when_ready(ctx, &db, &Cp::into_container(file, &db.container, &remote))?;
}
let kind = match &dump {
@@ -284,7 +280,7 @@ fn dump_directory(ctx: &Ctx, db: &Database, target: &Path) -> Result<()> {
.in_container(&db.container)
.run(ctx)?;
let copied = Cp::out_of_container(&db.container, &remote, &target.to_string_lossy()).run(ctx);
let copied = Cp::out_of_container(&db.container, &remote, target).run(ctx);
let _ = Rm::recursive(&remote).in_container(&db.container).run(ctx);