Repository navigation
Commit da0fe0d
fix(submodule): follow the current superproject branch on update
When a submodule with `branch = .` was cloned on `dev`, subsequent
`update(to_latest_revision=True)` calls kept using `origin/dev` after
the superproject switched to `master`. The branch selection only
resolved `.` during cloning.
Resolve the remote-tracking ref from the current superproject branch
when selecting the latest revision. If the selected ref differs from
the submodule's upstream, check out its commit detached to preserve
the local branch.
The regression switches the superproject from `dev` to `master`,
fetches a newer `master` commit, and switches back using cached refs.
It failed before the fix and passes with the CLI and Gix backends.
Git's `submodule update --remote` selects the same commits.
Agent-Model: gpt-6.2-sol
Agent-Reasoning-Effort: high1 parent df722c2 commit da0fe0d
2 files changed
Lines changed: 52 additions & 20 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
901 | 901 | | |
902 | 902 | | |
903 | 903 | | |
904 | | - | |
| 904 | + | |
| 905 | + | |
| 906 | + | |
905 | 907 | | |
906 | 908 | | |
907 | 909 | | |
| |||
1122 | 1124 | | |
1123 | 1125 | | |
1124 | 1126 | | |
1125 | | - | |
| 1127 | + | |
1126 | 1128 | | |
1127 | 1129 | | |
1128 | 1130 | | |
1129 | | - | |
| 1131 | + | |
1130 | 1132 | | |
1131 | 1133 | | |
1132 | 1134 | | |
1133 | 1135 | | |
1134 | | - | |
1135 | | - | |
1136 | | - | |
1137 | | - | |
1138 | | - | |
1139 | | - | |
1140 | | - | |
1141 | | - | |
1142 | | - | |
1143 | | - | |
1144 | | - | |
1145 | | - | |
1146 | | - | |
1147 | | - | |
| 1136 | + | |
| 1137 | + | |
| 1138 | + | |
| 1139 | + | |
| 1140 | + | |
| 1141 | + | |
| 1142 | + | |
| 1143 | + | |
| 1144 | + | |
| 1145 | + | |
| 1146 | + | |
| 1147 | + | |
| 1148 | + | |
| 1149 | + | |
| 1150 | + | |
| 1151 | + | |
1148 | 1152 | | |
1149 | | - | |
| 1153 | + | |
| 1154 | + | |
| 1155 | + | |
| 1156 | + | |
1150 | 1157 | | |
1151 | 1158 | | |
1152 | 1159 | | |
| |||
1169 | 1176 | | |
1170 | 1177 | | |
1171 | 1178 | | |
1172 | | - | |
| 1179 | + | |
1173 | 1180 | | |
1174 | 1181 | | |
1175 | 1182 | | |
| |||
1193 | 1200 | | |
1194 | 1201 | | |
1195 | 1202 | | |
1196 | | - | |
| 1203 | + | |
1197 | 1204 | | |
1198 | 1205 | | |
1199 | 1206 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1961 | 1961 | | |
1962 | 1962 | | |
1963 | 1963 | | |
| 1964 | + | |
| 1965 | + | |
| 1966 | + | |
| 1967 | + | |
| 1968 | + | |
| 1969 | + | |
| 1970 | + | |
| 1971 | + | |
| 1972 | + | |
| 1973 | + | |
| 1974 | + | |
| 1975 | + | |
| 1976 | + | |
| 1977 | + | |
| 1978 | + | |
| 1979 | + | |
| 1980 | + | |
| 1981 | + | |
| 1982 | + | |
| 1983 | + | |
| 1984 | + | |
| 1985 | + | |
| 1986 | + | |
| 1987 | + | |
| 1988 | + | |
1964 | 1989 | | |
1965 | 1990 | | |
1966 | 1991 | | |
| |||
0 commit comments