aboutsummaryrefslogtreecommitdiff
path: root/t/t7406-submodule-update.sh
diff options
context:
space:
mode:
authorStefan Beller <sbeller@google.com>2016-05-02 15:24:04 -0700
committerJunio C Hamano <gitster@pobox.com>2016-05-03 09:39:45 -0700
commitc66410ed32a807cefca6f679ad5583eda2e9527b (patch)
tree9cd7447cf882b34519bf4a4c8f59d0f833fc294d /t/t7406-submodule-update.sh
parent08fdbdb153c138f0a2dc85949475fafb20853d96 (diff)
downloadgit-c66410ed32a807cefca6f679ad5583eda2e9527b.tar.gz
git-c66410ed32a807cefca6f679ad5583eda2e9527b.tar.xz
submodule init: redirect stdout to stderr
Reroute the output of stdout to stderr as it is just informative messages, not to be consumed by machines. This should not regress any scripts that try to parse the current output, as the output is already internationalized and therefore unstable. We want to init submodules from the helper for `submodule update` in a later patch and the stdout output of said helper is consumed by the parts of `submodule update` which are still written in shell. So we have to be careful which messages are on stdout. Signed-off-by: Stefan Beller <sbeller@google.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 't/t7406-submodule-update.sh')
-rwxr-xr-xt/t7406-submodule-update.sh24
1 files changed, 18 insertions, 6 deletions
diff --git a/t/t7406-submodule-update.sh b/t/t7406-submodule-update.sh
index fd741f506..5f278799d 100755
--- a/t/t7406-submodule-update.sh
+++ b/t/t7406-submodule-update.sh
@@ -108,24 +108,36 @@ pwd=$(pwd)
cat <<EOF >expect
Submodule path '../super': checked out '$supersha1'
-Submodule 'merging' ($pwd/merging) registered for path '../super/merging'
-Submodule 'none' ($pwd/none) registered for path '../super/none'
-Submodule 'rebasing' ($pwd/rebasing) registered for path '../super/rebasing'
-Submodule 'submodule' ($pwd/submodule) registered for path '../super/submodule'
Submodule path '../super/merging': checked out '$mergingsha1'
Submodule path '../super/none': checked out '$nonesha1'
Submodule path '../super/rebasing': checked out '$rebasingsha1'
Submodule path '../super/submodule': checked out '$submodulesha1'
EOF
+cat <<EOF >expect2
+Submodule 'merging' ($pwd/merging) registered for path '../super/merging'
+Submodule 'none' ($pwd/none) registered for path '../super/none'
+Submodule 'rebasing' ($pwd/rebasing) registered for path '../super/rebasing'
+Submodule 'submodule' ($pwd/submodule) registered for path '../super/submodule'
+Cloning into '$pwd/recursivesuper/super/merging'...
+done.
+Cloning into '$pwd/recursivesuper/super/none'...
+done.
+Cloning into '$pwd/recursivesuper/super/rebasing'...
+done.
+Cloning into '$pwd/recursivesuper/super/submodule'...
+done.
+EOF
+
test_expect_success 'submodule update --init --recursive from subdirectory' '
git -C recursivesuper/super reset --hard HEAD^ &&
(cd recursivesuper &&
mkdir tmp &&
cd tmp &&
- git submodule update --init --recursive ../super >../../actual
+ git submodule update --init --recursive ../super >../../actual 2>../../actual2
) &&
- test_cmp expect actual
+ test_cmp expect actual &&
+ test_cmp expect2 actual2
'
apos="'";