Skip to content

Commit

Permalink
submodule update: direct error message to stderr
Browse files Browse the repository at this point in the history
Reroute the error message for specified but initialized submodules
to stderr instead of stdout.

Reviewed-by: Jonathan Nieder <jrnieder@gmail.com>
Signed-off-by: Stefan Beller <sbeller@google.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
  • Loading branch information
Stefan Beller authored and Junio C Hamano committed Mar 1, 2016
1 parent a028a19 commit 8c6b549
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions git-submodule.sh
Original file line number Diff line number Diff line change
Expand Up @@ -693,7 +693,7 @@ cmd_update()

if test "$update_module" = "none"
then
echo "Skipping submodule '$displaypath'"
echo >&2 "Skipping submodule '$displaypath'"
continue
fi

Expand All @@ -702,7 +702,7 @@ cmd_update()
# Only mention uninitialized submodules when its
# path have been specified
test "$#" != "0" &&
say "$(eval_gettext "Submodule path '\$displaypath' not initialized
say >&2 "$(eval_gettext "Submodule path '\$displaypath' not initialized
Maybe you want to use 'update --init'?")"
continue
fi
Expand Down
4 changes: 2 additions & 2 deletions t/t7400-submodule-basic.sh
Original file line number Diff line number Diff line change
Expand Up @@ -462,7 +462,7 @@ test_expect_success 'update --init' '
git config --remove-section submodule.example &&
test_must_fail git config submodule.example.url &&
git submodule update init > update.out &&
git submodule update init 2> update.out &&
cat update.out &&
test_i18ngrep "not initialized" update.out &&
test_must_fail git rev-parse --resolve-git-dir init/.git &&
Expand All @@ -480,7 +480,7 @@ test_expect_success 'update --init from subdirectory' '
mkdir -p sub &&
(
cd sub &&
git submodule update ../init >update.out &&
git submodule update ../init 2>update.out &&
cat update.out &&
test_i18ngrep "not initialized" update.out &&
test_must_fail git rev-parse --resolve-git-dir ../init/.git &&
Expand Down

0 comments on commit 8c6b549

Please sign in to comment.