Commit 2696ea3
fix: match Unix
When copying a folder to an existing directory, Unix `cp -r` nests the
source folder inside it (e.g. `cp -r src dst` → `dst/src/...`). The
previous implementation always copied contents directly (→ `dst/...`),
which is rsync-like rather than cp-like.
Track `destination_exists_as_directory` separately from the
`destination_is_directory` flag (which also covers trailing-slash hints)
so that folder copies can distinguish "destination exists" from
"destination was requested as a directory". Nesting only applies when
the destination actually exists as a prefix in the bucket.
Co-Authored-By: Claude Opus 4.6 (1M context) <[email protected]>cp -r nesting semantics in copy_files
1 parent 3b383db commit 2696ea3
2 files changed
Lines changed: 74 additions & 8 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
12621 | 12621 | | |
12622 | 12622 | | |
12623 | 12623 | | |
12624 | | - | |
| 12624 | + | |
| 12625 | + | |
| 12626 | + | |
| 12627 | + | |
| 12628 | + | |
12625 | 12629 | | |
| 12630 | + | |
12626 | 12631 | | |
12627 | | - | |
| 12632 | + | |
12628 | 12633 | | |
12629 | 12634 | | |
12630 | 12635 | | |
12631 | 12636 | | |
12632 | | - | |
| 12637 | + | |
| 12638 | + | |
12633 | 12639 | | |
12634 | 12640 | | |
12635 | 12641 | | |
| |||
12640 | 12646 | | |
12641 | 12647 | | |
12642 | 12648 | | |
| 12649 | + | |
| 12650 | + | |
12643 | 12651 | | |
12644 | 12652 | | |
12645 | 12653 | | |
| |||
12665 | 12673 | | |
12666 | 12674 | | |
12667 | 12675 | | |
| 12676 | + | |
| 12677 | + | |
| 12678 | + | |
| 12679 | + | |
| 12680 | + | |
| 12681 | + | |
| 12682 | + | |
| 12683 | + | |
12668 | 12684 | | |
12669 | 12685 | | |
12670 | 12686 | | |
| |||
12712 | 12728 | | |
12713 | 12729 | | |
12714 | 12730 | | |
12715 | | - | |
12716 | 12731 | | |
12717 | 12732 | | |
12718 | 12733 | | |
| |||
12744 | 12759 | | |
12745 | 12760 | | |
12746 | 12761 | | |
12747 | | - | |
12748 | 12762 | | |
12749 | 12763 | | |
12750 | 12764 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
388 | 388 | | |
389 | 389 | | |
390 | 390 | | |
391 | | - | |
| 391 | + | |
392 | 392 | | |
393 | 393 | | |
394 | 394 | | |
| |||
397 | 397 | | |
398 | 398 | | |
399 | 399 | | |
| 400 | + | |
400 | 401 | | |
401 | 402 | | |
402 | | - | |
403 | | - | |
| 403 | + | |
| 404 | + | |
404 | 405 | | |
405 | 406 | | |
406 | 407 | | |
| |||
449 | 450 | | |
450 | 451 | | |
451 | 452 | | |
| 453 | + | |
| 454 | + | |
| 455 | + | |
| 456 | + | |
| 457 | + | |
| 458 | + | |
| 459 | + | |
| 460 | + | |
| 461 | + | |
| 462 | + | |
| 463 | + | |
| 464 | + | |
| 465 | + | |
| 466 | + | |
| 467 | + | |
| 468 | + | |
| 469 | + | |
| 470 | + | |
| 471 | + | |
| 472 | + | |
| 473 | + | |
| 474 | + | |
| 475 | + | |
| 476 | + | |
| 477 | + | |
| 478 | + | |
| 479 | + | |
| 480 | + | |
| 481 | + | |
| 482 | + | |
| 483 | + | |
| 484 | + | |
| 485 | + | |
| 486 | + | |
| 487 | + | |
| 488 | + | |
| 489 | + | |
| 490 | + | |
| 491 | + | |
| 492 | + | |
| 493 | + | |
| 494 | + | |
| 495 | + | |
| 496 | + | |
| 497 | + | |
| 498 | + | |
| 499 | + | |
| 500 | + | |
| 501 | + | |
| 502 | + | |
| 503 | + | |
452 | 504 | | |
453 | 505 | | |
454 | 506 | | |
| |||
0 commit comments