Skip to content

Commit 5f439cd

Browse files
sschuberthpatthoyts
authored andcommitted
submodule: Use cat instead of echo to avoid DOS line-endings, was: Re: 4msysgit & tags
In msysGit, echo used in scripts outputs DOS line-endings while built-ins use Unix line-endings in their output. This causes t7508-status to fail due to mixed line endings in the output of git status (which calls git-submodule). Signed-off-by: Sebastian Schuberth <[email protected]>
1 parent 107dbe5 commit 5f439cd

File tree

1 file changed

+8
-4
lines changed

1 file changed

+8
-4
lines changed

git-submodule.sh

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -742,12 +742,16 @@ cmd_summary() {
742742
done |
743743
if test -n "$for_status"; then
744744
if [ -n "$files" ]; then
745-
echo "# Submodules changed but not updated:"
745+
status_msg="# Submodules changed but not updated:"
746746
else
747-
echo "# Submodule changes to be committed:"
747+
status_msg="# Submodule changes to be committed:"
748748
fi
749-
echo "#"
750-
sed -e 's|^|# |' -e 's|^# $|#|'
749+
status_sed=$(sed -e 's|^|# |' -e 's|^# $|#|')
750+
cat <<EOF
751+
$status_msg
752+
#
753+
$status_sed
754+
EOF
751755
else
752756
cat
753757
fi

0 commit comments

Comments
 (0)