Skip to content

unpack-trees: fix '--recurse-submodules' when switching from no submodules to nested submodules

Philippe Blain via GitGitGadget git 1 version In review

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 Latest6 patches 2 repliesIn review

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/6t7112: remove mention of KNOWN_FAILURE_SUBMODULE_RECURSIVE_NESTEDt/t7112-reset-submodule.sh+0 -11 reply
2/6t/lib-submodule-update: remove outdated test descriptiont/lib-submodule-update.sh+0 -10 replies
3/6t/lib-submodule-update: move a test to the right sectiont/lib-submodule-update.sh+17 -160 replies
4/6unpack-trees: remove outdated description for verify_clean_submoduleunpack-trees.c+0 -30 replies
5/6unpack-trees: check for missing submodule directory in merged_entryt/lib-submodule-update.sh unpack-trees.c+16 -21 reply
6/6t/lib-submodule-update: add test removing nested submodulest/lib-submodule-update.sh+18 -20 replies

Reviews trailers per patch

No Reviewed-by, Acked-by or Tested-by trailers for v1 yet.

Read the v1 thread

Cover letter [PATCH 0/6] unpack-trees: fix '--recurse-submodules' when switching from no submodules to nested submodules

Currently, using git checkout --recurse-submodules (or the submodule.recurse config) to switch from a commit with no submodules to a commit with initialized nested submodules fails because a child git process tries to cd to a yet non-existing nested submodule directory. reset and read-tree are also affected in the same way since they also use the unpack-trees machinery.

The 5th commit in this series fixes this bug. The first four are clean-up patches in tests and in unpack-trees that mostly remove outdated comments/dead code. The 6th commit adds a test for the reverse transition (nested submodules -> no submodules) as it was not being tested.

The commit message of the 5th commit is quite long, as I tried to describe clearly what is the cause of the bug.

Philippe Blain (6):
t7112: remove mention of KNOWN_FAILURE_SUBMODULE_RECURSIVE_NESTED t/lib-submodule-update: remove outdated test description t/lib-submodule-update: move a test to the right section
unpack-trees: remove outdated description for verify_clean_submodule
unpack-trees: check for missing submodule directory in merged_entry t/lib-submodule-update: add test removing nested submodules

 t/lib-submodule-update.sh  | 68 +++++++++++++++++++++++++++-----------
 t/t7112-reset-submodule.sh |  1 -
 unpack-trees.c             |  7 ++--
 3 files changed, 51 insertions(+), 25 deletions(-)

base-commit: d8437c57fa0752716dde2d3747e7c22bf7ce2e41
Published-As: https://github.com/gitgitgadget/git/releases/tag/pr-555%2Fphil-blain%2Fcheckout-recurse-nested-v1
Fetch-It-Via: git fetch https://github.com/gitgitgadget/git pr-555/phil-blain/checkout-recurse-nested-v1
Pull-Request: https://github.com/gitgitgadget/git/pull/555

Signature · 1 line
gitgitgadget