Commit aed82f9
fix(devcontainer): only init missing submodules on container start
git submodule update --init runs on every postCreate, which on
container rebuild moves any submodule whose HEAD differs from the
parent's pinned SHA into detached HEAD — silently yanking
in-progress branch work in initialized submodules. The data isn't
lost (reachable via reflog and existing branches) but recovery
requires submodule literacy that not every user has.
Filter to only the uninitialized submodules using git submodule
status output (leading '-'), preserving the first-clone build
protection without touching already-checked-out submodules. Applies
to all generated projects, not just the Claude-sandbox case.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>1 parent 19099d9 commit aed82f9
2 files changed
Lines changed: 14 additions & 4 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
6 | 6 | | |
7 | 7 | | |
8 | 8 | | |
9 | | - | |
10 | | - | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
9 | 9 | | |
10 | 10 | | |
11 | 11 | | |
12 | | - | |
13 | | - | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
0 commit comments