Commit 81e052d
committed
fix(files): resolve an overwrite target by id, not a joined reference
A slash-delimited reference cannot express a folder whose own name contains a
slash. `Q3/Q4` joins to two segments and re-reads as two levels, so the overwrite
lookup never found the existing file and the write landed as a duplicate beside
it. The guard on folder id and name meant it could not overwrite the WRONG file,
which is why this was bounded rather than dangerous.
I introduced it: before this branch the segments came only from splitting the
file name, so no segment could contain a slash. Prepending the picked folder's
decoded segments is what made one able to.
When a folder was picked its canonical path is unambiguous, so the target is
found inside that folder by name and resolved by id — the same route the named
append now takes, using the same authorized expansion. A typed path with no
picked folder keeps the joined reference, which is exactly as expressive as the
name it came from.1 parent 94176fc commit 81e052d
2 files changed
Lines changed: 74 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
458 | 458 | | |
459 | 459 | | |
460 | 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 | + | |
| 504 | + | |
| 505 | + | |
| 506 | + | |
461 | 507 | | |
462 | 508 | | |
463 | 509 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
505 | 505 | | |
506 | 506 | | |
507 | 507 | | |
| 508 | + | |
| 509 | + | |
508 | 510 | | |
509 | 511 | | |
510 | 512 | | |
511 | | - | |
| 513 | + | |
| 514 | + | |
| 515 | + | |
| 516 | + | |
| 517 | + | |
| 518 | + | |
| 519 | + | |
| 520 | + | |
| 521 | + | |
| 522 | + | |
| 523 | + | |
| 524 | + | |
| 525 | + | |
| 526 | + | |
| 527 | + | |
| 528 | + | |
| 529 | + | |
| 530 | + | |
| 531 | + | |
| 532 | + | |
| 533 | + | |
| 534 | + | |
| 535 | + | |
| 536 | + | |
512 | 537 | | |
513 | 538 | | |
514 | 539 | | |
515 | 540 | | |
516 | 541 | | |
517 | 542 | | |
518 | | - | |
| 543 | + | |
519 | 544 | | |
520 | 545 | | |
521 | 546 | | |
| |||
1016 | 1041 | | |
1017 | 1042 | | |
1018 | 1043 | | |
| 1044 | + | |
1019 | 1045 | | |
1020 | 1046 | | |
1021 | 1047 | | |
| |||
0 commit comments