From: Junio C Hamano Date: Wed, 3 Mar 2010 22:19:10 +0000 (-0800) Subject: submodule summary: do not fail before the first commit X-Git-Tag: v1.7.1-rc0~42^2~1 X-Git-Url: https://git.tokkee.org/?a=commitdiff_plain;h=14e940d719e9d3250b802fbc975210dafaf896d8;p=git.git submodule summary: do not fail before the first commit When "git status" collects changes for the index (usually relative to HEAD), it compares the index with an empty tree when the repository does not have an initial commit yet. "git submodule summary" is about asking what submodule changes would be recorded if a commit is made right now, and should do the same comparison to report all the added submodules, instead of punting and being silent. Signed-off-by: Junio C Hamano --- diff --git a/git-submodule.sh b/git-submodule.sh index 383dc4511..9aa57dd6f 100755 --- a/git-submodule.sh +++ b/git-submodule.sh @@ -559,7 +559,8 @@ cmd_summary() { test $# = 0 || shift elif test -z "$1" -o "$1" = "HEAD" then - return + # before the first commit: compare with an empty tree + head=$(git hash-object -w -t tree --stdin