Merge branch 'jh/maint-submodule-status-in-void'

* jh/maint-submodule-status-in-void:
  git submodule summary: Handle HEAD as argument when on an unborn branch
  submodule summary: do not fail before the first commit
This commit is contained in:
Junio C Hamano 2010-03-24 16:55:37 -07:00
commit 5e4f614742

View File

@ -559,7 +559,9 @@ cmd_summary() {
test $# = 0 || shift test $# = 0 || shift
elif test -z "$1" -o "$1" = "HEAD" elif test -z "$1" -o "$1" = "HEAD"
then then
return # before the first commit: compare with an empty tree
head=$(git hash-object -w -t tree --stdin </dev/null)
test -z "$1" || shift
else else
head="HEAD" head="HEAD"
fi fi