Repository navigation
Commit 919b169
committed
fix(submodule): honor branch overrides in accessors
The accessors resolved `branch = .` from `.gitmodules` even when the
superproject's Git config selected a named branch. This exposed the
wrong branch on an attached superproject and raised while detached.
Use `_branch_for_update()` to apply the same override precedence as
remote updates. Preserve the accessor-specific error for unresolved
inheritance and the recursive Git lookup for symbolic `HEAD` aliases.
Only look up an override when the submodule has a name, so callers can
still read an explicit branch path on an unnamed instance.
The override and unnamed-path regressions failed before their fixes.
The focused branch accessor, override, and alias tests pass under both
the CLI and Gix backends.
Agent-Model: unknown1 parent be93e83 commit 919b169
3 files changed
Lines changed: 33 additions & 15 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
202 | 202 | | |
203 | 203 | | |
204 | 204 | | |
205 | | - | |
206 | | - | |
| 205 | + | |
| 206 | + | |
| 207 | + | |
207 | 208 | | |
208 | 209 | | |
209 | 210 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1835 | 1835 | | |
1836 | 1836 | | |
1837 | 1837 | | |
1838 | | - | |
| 1838 | + | |
| 1839 | + | |
1839 | 1840 | | |
1840 | 1841 | | |
1841 | 1842 | | |
1842 | 1843 | | |
1843 | 1844 | | |
1844 | | - | |
1845 | | - | |
1846 | | - | |
1847 | | - | |
| 1845 | + | |
| 1846 | + | |
1848 | 1847 | | |
1849 | 1848 | | |
1850 | 1849 | | |
| |||
1879 | 1878 | | |
1880 | 1879 | | |
1881 | 1880 | | |
1882 | | - | |
1883 | | - | |
1884 | | - | |
1885 | | - | |
1886 | | - | |
1887 | | - | |
1888 | | - | |
| 1881 | + | |
| 1882 | + | |
| 1883 | + | |
| 1884 | + | |
| 1885 | + | |
| 1886 | + | |
| 1887 | + | |
| 1888 | + | |
| 1889 | + | |
1889 | 1890 | | |
1890 | 1891 | | |
1891 | | - | |
| 1892 | + | |
1892 | 1893 | | |
1893 | 1894 | | |
1894 | 1895 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2016 | 2016 | | |
2017 | 2017 | | |
2018 | 2018 | | |
| 2019 | + | |
| 2020 | + | |
| 2021 | + | |
| 2022 | + | |
| 2023 | + | |
| 2024 | + | |
2019 | 2025 | | |
| 2026 | + | |
2020 | 2027 | | |
2021 | 2028 | | |
2022 | 2029 | | |
2023 | 2030 | | |
2024 | 2031 | | |
2025 | 2032 | | |
| 2033 | + | |
| 2034 | + | |
| 2035 | + | |
| 2036 | + | |
| 2037 | + | |
2026 | 2038 | | |
2027 | 2039 | | |
2028 | 2040 | | |
| |||
2088 | 2100 | | |
2089 | 2101 | | |
2090 | 2102 | | |
| 2103 | + | |
| 2104 | + | |
| 2105 | + | |
| 2106 | + | |
2091 | 2107 | | |
2092 | 2108 | | |
2093 | 2109 | | |
| |||
0 commit comments