Repository navigation
Commit b1f9818
* Start fix for #482, #548
Assisted-by: Claude Code:claude-opus-5-5
* Stop Gemfile rewrites declaring a gem twice
Hosted and vendored modes could leave a Gemfile that Bundler refuses
on every install ("You cannot specify the same gem twice"):
- Hosted mode rewrote only the first of several declarations of a gem
(for example one in each of two `group` blocks), leaving an exact
pin next to the original requirement (#548). It now refuses with
redirect_gem_declared_more_than_once, as vendored mode already did.
- Both modes treated a gem they could not see declared in the root
Gemfile as transitive and appended a second declaration, even when
the lock lists it under DEPENDENCIES because the Gemfile declares it
through eval_gemfile or a loop (#482). Both now refuse instead.
Fixes #482
Fixes #548
Assisted-by: Claude Code:claude-opus-5-5
* Test hosted gem refusals with real Bundler
Covers a gem declared in two group blocks (#548) and a direct
dependency declared through eval_gemfile (#482): the hosted scan must
leave the Gemfile pair untouched, attest nothing, and Bundler must
still install the project.
Assisted-by: Claude Code:claude-opus-5-5
* Test vendored eval_gemfile refusal with Bundler
A direct dependency declared through eval_gemfile must be refused
before any write (#482), and Bundler must still install the project
frozen and unfrozen.
Assisted-by: Claude Code:claude-opus-5-5
* Format the duplicate-declaration e2e assert
Wraps one long assert in the new Bundler capstone so rustfmt leaves
the file unchanged. No behavior change.
Assisted-by: Claude Code:claude-opus-5-5
* Count only real gem declarations as duplicates
Hosted redirect refused a Gemfile with one editable declaration when
another gem call quoted the same name, e.g. `gem "other", require:
"rack"` or a trailing comment. Only `gem` calls whose first argument is
the gem now count toward the more-than-once refusal. The looser probe
still gates appending a source block.
Assisted-by: Claude Code:claude-opus-5-5
---------
Co-authored-by: Claude <noreply@anthropic.com>
1 parent 42e7734 commit b1f9818
5 files changed
Lines changed: 489 additions & 24 deletions
File tree
- crates
- socket-patch-cli/tests
- socket-patch-core/src
- formats/gem
- patch/redirect
- vendor
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
413 | 413 | | |
414 | 414 | | |
415 | 415 | | |
| 416 | + | |
| 417 | + | |
| 418 | + | |
| 419 | + | |
| 420 | + | |
| 421 | + | |
| 422 | + | |
| 423 | + | |
| 424 | + | |
| 425 | + | |
| 426 | + | |
416 | 427 | | |
417 | 428 | | |
418 | 429 | | |
| |||
426 | 437 | | |
427 | 438 | | |
428 | 439 | | |
| 440 | + | |
| 441 | + | |
429 | 442 | | |
430 | 443 | | |
431 | 444 | | |
| |||
691 | 704 | | |
692 | 705 | | |
693 | 706 | | |
694 | | - | |
695 | | - | |
696 | | - | |
697 | | - | |
698 | | - | |
| 707 | + | |
| 708 | + | |
| 709 | + | |
| 710 | + | |
| 711 | + | |
| 712 | + | |
| 713 | + | |
| 714 | + | |
| 715 | + | |
| 716 | + | |
| 717 | + | |
| 718 | + | |
| 719 | + | |
| 720 | + | |
| 721 | + | |
| 722 | + | |
699 | 723 | | |
700 | 724 | | |
701 | 725 | | |
| |||
795 | 819 | | |
796 | 820 | | |
797 | 821 | | |
798 | | - | |
| 822 | + | |
| 823 | + | |
| 824 | + | |
| 825 | + | |
| 826 | + | |
799 | 827 | | |
800 | 828 | | |
801 | 829 | | |
| |||
849 | 877 | | |
850 | 878 | | |
851 | 879 | | |
| 880 | + | |
| 881 | + | |
| 882 | + | |
| 883 | + | |
| 884 | + | |
| 885 | + | |
| 886 | + | |
| 887 | + | |
| 888 | + | |
| 889 | + | |
| 890 | + | |
| 891 | + | |
| 892 | + | |
| 893 | + | |
| 894 | + | |
852 | 895 | | |
853 | 896 | | |
854 | 897 | | |
| |||
922 | 965 | | |
923 | 966 | | |
924 | 967 | | |
925 | | - | |
926 | | - | |
927 | | - | |
| 968 | + | |
| 969 | + | |
| 970 | + | |
| 971 | + | |
928 | 972 | | |
929 | 973 | | |
930 | 974 | | |
| |||
978 | 1022 | | |
979 | 1023 | | |
980 | 1024 | | |
| 1025 | + | |
| 1026 | + | |
| 1027 | + | |
| 1028 | + | |
| 1029 | + | |
| 1030 | + | |
| 1031 | + | |
| 1032 | + | |
| 1033 | + | |
| 1034 | + | |
| 1035 | + | |
| 1036 | + | |
| 1037 | + | |
| 1038 | + | |
| 1039 | + | |
| 1040 | + | |
| 1041 | + | |
| 1042 | + | |
| 1043 | + | |
| 1044 | + | |
| 1045 | + | |
| 1046 | + | |
| 1047 | + | |
| 1048 | + | |
| 1049 | + | |
| 1050 | + | |
| 1051 | + | |
| 1052 | + | |
| 1053 | + | |
| 1054 | + | |
| 1055 | + | |
| 1056 | + | |
| 1057 | + | |
| 1058 | + | |
| 1059 | + | |
| 1060 | + | |
| 1061 | + | |
| 1062 | + | |
| 1063 | + | |
| 1064 | + | |
| 1065 | + | |
| 1066 | + | |
| 1067 | + | |
981 | 1068 | | |
982 | 1069 | | |
983 | 1070 | | |
| |||
1530 | 1617 | | |
1531 | 1618 | | |
1532 | 1619 | | |
1533 | | - | |
1534 | | - | |
| 1620 | + | |
| 1621 | + | |
| 1622 | + | |
| 1623 | + | |
| 1624 | + | |
| 1625 | + | |
| 1626 | + | |
| 1627 | + | |
| 1628 | + | |
| 1629 | + | |
| 1630 | + | |
| 1631 | + | |
| 1632 | + | |
| 1633 | + | |
1535 | 1634 | | |
1536 | 1635 | | |
1537 | | - | |
| 1636 | + | |
| 1637 | + | |
1538 | 1638 | | |
1539 | 1639 | | |
1540 | | - | |
| 1640 | + | |
| 1641 | + | |
| 1642 | + | |
| 1643 | + | |
1541 | 1644 | | |
1542 | 1645 | | |
1543 | 1646 | | |
| |||
1575 | 1678 | | |
1576 | 1679 | | |
1577 | 1680 | | |
| 1681 | + | |
| 1682 | + | |
| 1683 | + | |
| 1684 | + | |
| 1685 | + | |
| 1686 | + | |
| 1687 | + | |
| 1688 | + | |
| 1689 | + | |
| 1690 | + | |
| 1691 | + | |
| 1692 | + | |
| 1693 | + | |
| 1694 | + | |
| 1695 | + | |
| 1696 | + | |
| 1697 | + | |
| 1698 | + | |
| 1699 | + | |
| 1700 | + | |
| 1701 | + | |
| 1702 | + | |
| 1703 | + | |
| 1704 | + | |
| 1705 | + | |
| 1706 | + | |
| 1707 | + | |
| 1708 | + | |
| 1709 | + | |
| 1710 | + | |
| 1711 | + | |
| 1712 | + | |
| 1713 | + | |
| 1714 | + | |
| 1715 | + | |
| 1716 | + | |
| 1717 | + | |
| 1718 | + | |
| 1719 | + | |
1578 | 1720 | | |
1579 | 1721 | | |
1580 | 1722 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1562 | 1562 | | |
1563 | 1563 | | |
1564 | 1564 | | |
| 1565 | + | |
| 1566 | + | |
| 1567 | + | |
| 1568 | + | |
| 1569 | + | |
| 1570 | + | |
| 1571 | + | |
| 1572 | + | |
| 1573 | + | |
| 1574 | + | |
| 1575 | + | |
| 1576 | + | |
| 1577 | + | |
| 1578 | + | |
| 1579 | + | |
| 1580 | + | |
| 1581 | + | |
| 1582 | + | |
| 1583 | + | |
| 1584 | + | |
| 1585 | + | |
| 1586 | + | |
| 1587 | + | |
| 1588 | + | |
| 1589 | + | |
| 1590 | + | |
| 1591 | + | |
| 1592 | + | |
| 1593 | + | |
| 1594 | + | |
| 1595 | + | |
| 1596 | + | |
| 1597 | + | |
| 1598 | + | |
| 1599 | + | |
| 1600 | + | |
| 1601 | + | |
| 1602 | + | |
| 1603 | + | |
| 1604 | + | |
| 1605 | + | |
| 1606 | + | |
| 1607 | + | |
| 1608 | + | |
| 1609 | + | |
| 1610 | + | |
| 1611 | + | |
| 1612 | + | |
| 1613 | + | |
| 1614 | + | |
| 1615 | + | |
| 1616 | + | |
| 1617 | + | |
| 1618 | + | |
| 1619 | + | |
| 1620 | + | |
| 1621 | + | |
| 1622 | + | |
| 1623 | + | |
| 1624 | + | |
| 1625 | + | |
| 1626 | + | |
| 1627 | + | |
| 1628 | + | |
| 1629 | + | |
| 1630 | + | |
| 1631 | + | |
| 1632 | + | |
| 1633 | + | |
| 1634 | + | |
| 1635 | + | |
| 1636 | + | |
| 1637 | + | |
| 1638 | + | |
| 1639 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
114 | 114 | | |
115 | 115 | | |
116 | 116 | | |
| 117 | + | |
| 118 | + | |
| 119 | + | |
| 120 | + | |
117 | 121 | | |
118 | 122 | | |
119 | 123 | | |
| |||
222 | 226 | | |
223 | 227 | | |
224 | 228 | | |
| 229 | + | |
225 | 230 | | |
226 | 231 | | |
227 | 232 | | |
| |||
281 | 286 | | |
282 | 287 | | |
283 | 288 | | |
| 289 | + | |
| 290 | + | |
| 291 | + | |
| 292 | + | |
284 | 293 | | |
285 | 294 | | |
286 | 295 | | |
| |||
306 | 315 | | |
307 | 316 | | |
308 | 317 | | |
| 318 | + | |
309 | 319 | | |
310 | 320 | | |
311 | 321 | | |
312 | 322 | | |
| 323 | + | |
| 324 | + | |
| 325 | + | |
| 326 | + | |
| 327 | + | |
| 328 | + | |
| 329 | + | |
| 330 | + | |
| 331 | + | |
| 332 | + | |
313 | 333 | | |
314 | 334 | | |
315 | 335 | | |
| |||
0 commit comments