You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Improve UX around missing submodules and '--recurse-submodules' for clone and checkout #752
When a user clones a repo with --recurse-submodules, clone writes the pathspec . to the config submodule.active.
If this repo at some point in its history had a submodule, but this submodule was then removed, then checking out an older commit where the submodule is still present fails if the checkout uses --recurse-submodules.
Reproducer:
git init checkout-removed-submodule &&
cd checkout-removed-submodule/ &&
echo "Hello, world" >foo &&
git add foo && git commit -m "Initial commit" &&
git init ../submodule &&
cd ../submodule/ &&
echo "Foo bar" >foobar.txt &&
git add foobar.txt && git commit -m "Foo bar baz" &&
cd ../checkout-removed-submodule/ &&
git submodule add ../submodule/ foobar &&
git commit -m "Add foobar submodule" &&
git rm foobar/ &&
git commit -m "Remove foobar submodule" &&
cd ../ &&
git clone --recurse-submodules checkout-removed-submodule cloned-repo &&
cd cloned-repo &&
git co --recurse-submodules HEAD~
fatal: not a git repository: ../.git/modules/foobar
fatal: could not reset submodule index
changed the title [-]Improve UX around removed submodules and '--recurse-submodules' for `clone` and `checkout`[/-][+]Improve UX around missing submodules and '--recurse-submodules' for `clone` and `checkout`[/+]on Aug 29, 2022
Activity
[-]Improve UX around removed submodules and '--recurse-submodules' for `clone` and `checkout`[/-][+]Improve UX around missing submodules and '--recurse-submodules' for `clone` and `checkout`[/+]phil-blain commentedon Aug 29, 2022
Also related:
update=none)