git-submodule summary: fix that some "wc" flavors produce leading spaces
authorJohannes Sixt <johannes.sixt@telecom.at>
Wed, 12 Mar 2008 08:30:01 +0000 (09:30 +0100)
committerJunio C Hamano <gitster@pobox.com>
Wed, 12 Mar 2008 08:53:30 +0000 (01:53 -0700)
We print the number of commits in parentheses, but without this change
we would get an oddly looking line like this:

* sm1 4c8d358...41fbea9 ( 4):

Signed-off-by: Johannes Sixt <johannes.sixt@telecom.at>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
git-submodule.sh
index 4d28fc0988f1359e914cd27e3750cf01f223527e..558a5ca1073953a752a5727809686612e10ed5d3 100755 (executable)
@@ -448,7 +448,7 @@ cmd_summary() {
                        GIT_DIR="$name/.git" \
                        git log --pretty=oneline --first-parent $range | wc -l
                        )
                        GIT_DIR="$name/.git" \
                        git log --pretty=oneline --first-parent $range | wc -l
                        )
-                       total_commits=" ($total_commits)"
+                       total_commits=" ($(($total_commits + 0)))"
                        ;;
                esac
 
                        ;;
                esac