Commit 61ca278
committed
feat(submodule): add deinit method to Submodule (#2014)
Mirrors the pattern of `Submodule.add`, `Submodule.update`, and
`Submodule.remove` by exposing `git submodule deinit` as a first-class
method, so callers no longer need the `repo.git.submodule('deinit', ...)`
workaround noted in the issue.
The method delegates to `git submodule deinit [--force] -- <path>` via
`self.repo.git.submodule`, decorated with `@unbare_repo` to match the
other mutating Submodule methods. It unregisters the submodule from
`.git/config` and clears the working-tree directory while leaving
`.gitmodules` and `.git/modules/<name>` intact, so a later `update()`
can re-initialize.
Closes #2014.1 parent 75e6c6b commit 61ca278
1 file changed
Lines changed: 31 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
49 | 49 | | |
50 | 50 | | |
51 | 51 | | |
| 52 | + | |
52 | 53 | | |
53 | 54 | | |
54 | 55 | | |
| |||
1267 | 1268 | | |
1268 | 1269 | | |
1269 | 1270 | | |
| 1271 | + | |
| 1272 | + | |
| 1273 | + | |
| 1274 | + | |
| 1275 | + | |
| 1276 | + | |
| 1277 | + | |
| 1278 | + | |
| 1279 | + | |
| 1280 | + | |
| 1281 | + | |
| 1282 | + | |
| 1283 | + | |
| 1284 | + | |
| 1285 | + | |
| 1286 | + | |
| 1287 | + | |
| 1288 | + | |
| 1289 | + | |
| 1290 | + | |
| 1291 | + | |
| 1292 | + | |
| 1293 | + | |
| 1294 | + | |
| 1295 | + | |
| 1296 | + | |
| 1297 | + | |
| 1298 | + | |
| 1299 | + | |
| 1300 | + | |
1270 | 1301 | | |
1271 | 1302 | | |
1272 | 1303 | | |
| |||
0 commit comments