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 <sbeller@google.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>

Stefan Beller committed Mar 29, 2016 at 18:27 UTC c1e06d11c7ab67080f0a08cd60b84c329442abb4
1 file changed +20
t/t7406-submodule-update.sh
+20
@@ -379,6 +379,26 @@ test_expect_success 'submodule update - command in .git/config catches failure -
379 test_cmp actual expect
380 '
381
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 +
402 test_expect_success 'submodule init does not copy command into .git/config' '
403 (cd super &&
404 H=$(git ls-files -s submodule | cut -d" " -f2) &&