Repository navigation
Commit ee89568
committed
review
<!-- agent -->
- [P2] Fall back when a relative URL has no tracking remote —
git/objects/submodule/base.py:432-435 For a locally initialized
superproject without a tracking branch, `create_submodule(...,
url='./source')` now enters this block and dereferences `None`, raising
`AttributeError` even when `./source` is a valid repository. This addition
succeeded before the patch; detached checkouts also fail at `active_branch`.
Handle missing tracking branches by falling back to `origin` or the
superproject directory, as Git does.
- [P2] Resolve relative submodule URLs only once —
git/objects/submodule/base.py:986-988 When `origin` is a local relative
URL such as `../repos/super.git` and the branch tracks that remote,
`_resolved_url()` turns `../child.git` into `../repos/child.git`. Because
that result still starts with `../`, `_clone_repo()` resolves it again,
producing `../repos/repos/child.git`. This can fail cloning or select the
wrong repository. Ensure URLs already resolved by `update()` bypass the second
resolution.
- [P2] Defer old-URL resolution until a remote change is needed —
git/objects/submodule/root.py:269-270 For an initialized superproject
without `origin`, changing `.gitmodules` from `../source` to the absolute
URL already used by the submodule's remote now raises `AttributeError` in
`psm._resolved_url()`. Previously, the existing-remote check skipped URL
handling and the update completed. Resolve the previous URL only after
checking whether the new URL already matches a remote, so updates requiring no
remote adjustment do not fail.1 parent 833c8d8 commit ee89568
3 files changed
Lines changed: 93 additions & 18 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
69 | 69 | | |
70 | 70 | | |
71 | 71 | | |
72 | | - | |
| 72 | + | |
73 | 73 | | |
74 | 74 | | |
75 | 75 | | |
| |||
429 | 429 | | |
430 | 430 | | |
431 | 431 | | |
432 | | - | |
433 | | - | |
434 | | - | |
435 | | - | |
436 | | - | |
437 | 432 | | |
438 | | - | |
| 433 | + | |
439 | 434 | | |
440 | 435 | | |
441 | 436 | | |
| |||
985 | 980 | | |
986 | 981 | | |
987 | 982 | | |
988 | | - | |
| 983 | + | |
989 | 984 | | |
990 | 985 | | |
991 | 986 | | |
| |||
1735 | 1730 | | |
1736 | 1731 | | |
1737 | 1732 | | |
| 1733 | + | |
| 1734 | + | |
| 1735 | + | |
| 1736 | + | |
| 1737 | + | |
| 1738 | + | |
| 1739 | + | |
| 1740 | + | |
| 1741 | + | |
| 1742 | + | |
| 1743 | + | |
| 1744 | + | |
| 1745 | + | |
| 1746 | + | |
| 1747 | + | |
| 1748 | + | |
1738 | 1749 | | |
1739 | | - | |
1740 | | - | |
1741 | | - | |
1742 | | - | |
1743 | | - | |
| 1750 | + | |
| 1751 | + | |
1744 | 1752 | | |
1745 | 1753 | | |
1746 | 1754 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
267 | 267 | | |
268 | 268 | | |
269 | 269 | | |
270 | | - | |
271 | 270 | | |
272 | 271 | | |
273 | 272 | | |
| |||
280 | 279 | | |
281 | 280 | | |
282 | 281 | | |
| 282 | + | |
283 | 283 | | |
284 | 284 | | |
285 | 285 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
53 | 53 | | |
54 | 54 | | |
55 | 55 | | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
| 105 | + | |
| 106 | + | |
| 107 | + | |
| 108 | + | |
| 109 | + | |
| 110 | + | |
| 111 | + | |
| 112 | + | |
| 113 | + | |
| 114 | + | |
| 115 | + | |
| 116 | + | |
| 117 | + | |
| 118 | + | |
| 119 | + | |
| 120 | + | |
| 121 | + | |
56 | 122 | | |
57 | 123 | | |
58 | 124 | | |
| |||
2459 | 2525 | | |
2460 | 2526 | | |
2461 | 2527 | | |
2462 | | - | |
| 2528 | + | |
2463 | 2529 | | |
2464 | 2530 | | |
2465 | | - | |
| 2531 | + | |
2466 | 2532 | | |
2467 | 2533 | | |
2468 | 2534 | | |
2469 | 2535 | | |
2470 | 2536 | | |
2471 | | - | |
2472 | | - | |
| 2537 | + | |
| 2538 | + | |
| 2539 | + | |
2473 | 2540 | | |
2474 | 2541 | | |
2475 | 2542 | | |
| |||
0 commit comments