mirror of
https://github.com/basicmachines-co/basic-memory
synced 2026-06-21 13:47:35 +00:00
fix(cli): add --local-no-preallocate to conflict-copy copyto
Code-review finding: project_copy_file built its `rclone copyto` command inline and omitted `--local-no-preallocate`. On a `pull --on-conflict keep-both` that copyto writes the conflict copy to the local filesystem, which is exactly the case the flag guards (NUL byte padding on virtual filesystems such as Google Drive File Stream). Every other transfer path adds it via _build_transfer_cmd; bring copyto in line. Signed-off-by: phernandez <paul@basicmachines.co>
This commit is contained in:
@@ -471,6 +471,10 @@ def project_copy_file(
|
||||
f"{source_root}/{source_rel_path}",
|
||||
f"{dest_root}/{dest_rel_path}",
|
||||
*TIGRIS_CONSISTENCY_HEADERS,
|
||||
# Matches _build_transfer_cmd: on pull this writes the conflict copy to
|
||||
# the local filesystem, where this prevents NUL byte padding on virtual
|
||||
# filesystems (e.g. Google Drive File Stream). See rclone/rclone#6801.
|
||||
"--local-no-preallocate",
|
||||
]
|
||||
if verbose:
|
||||
cmd.append("--verbose")
|
||||
|
||||
@@ -721,6 +721,8 @@ def test_project_copy_file_pull_copyto_renames_on_dest(tmp_path):
|
||||
assert cmd[:2] == ["rclone", "copyto"]
|
||||
assert cmd[2] == "basic-memory-cloud:my-bucket/research/notes/dup.md"
|
||||
assert cmd[3] == "/tmp/research/notes/dup.conflict-S.md"
|
||||
# pull writes the conflict copy locally → must guard virtual-FS NUL padding
|
||||
assert "--local-no-preallocate" in cmd
|
||||
|
||||
|
||||
def test_project_transfer_keep_both_copies_conflicts_then_additive(tmp_path):
|
||||
|
||||
Reference in New Issue
Block a user