Skip to content

Commit c1e06d1

Browse files
stefanbellergitster
authored andcommitted
submodule update: test recursive path reporting from subdirectory
This patch is just a test and fixes no bug as there is currently no bug in the path handling of `submodule update`. In `submodule update` we make a call to `submodule--helper list --prefix "$wt_prefix"` which looks a bit brittle and likely to introduce a bug for the path handling. It is not a bug as the prefix is ignored inside the submodule helper for now. If this test breaks eventually, we want to make sure the `wt_prefix` is passed correctly into recursive submodules. Hint: In recursive submodules we expect `wt_prefix` to be empty. Signed-off-by: Stefan Beller <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent b08238a commit c1e06d1

File tree

1 file changed

+20
-0
lines changed

1 file changed

+20
-0
lines changed

t/t7406-submodule-update.sh

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -379,6 +379,26 @@ test_expect_success 'submodule update - command in .git/config catches failure -
379379
test_cmp actual expect
380380
'
381381

382+
cat << EOF >expect
383+
Execution of 'false $submodulesha1' failed in submodule path '../super/submodule'
384+
Failed to recurse into submodule path '../super'
385+
EOF
386+
387+
test_expect_success 'recursive submodule update - command in .git/config catches failure -- subdirectory' '
388+
(cd recursivesuper &&
389+
git submodule update --remote super &&
390+
git add super &&
391+
git commit -m "update to latest to have more than one commit in submodules"
392+
) &&
393+
git -C recursivesuper/super config submodule.submodule.update "!false" &&
394+
git -C recursivesuper/super/submodule reset --hard $submodulesha1^ &&
395+
(cd recursivesuper &&
396+
mkdir -p tmp && cd tmp &&
397+
test_must_fail git submodule update --recursive ../super 2>../../actual
398+
) &&
399+
test_cmp actual expect
400+
'
401+
382402
test_expect_success 'submodule init does not copy command into .git/config' '
383403
(cd super &&
384404
H=$(git ls-files -s submodule | cut -d" " -f2) &&

0 commit comments

Comments
 (0)