author | Junio C Hamano <gitster@pobox.com> | |
Wed, 24 Mar 2010 23:55:37 +0000 (16:55 -0700) | ||
committer | Junio C Hamano <gitster@pobox.com> | |
Wed, 24 Mar 2010 23:55:37 +0000 (16:55 -0700) |
* 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
git submodule summary: Handle HEAD as argument when on an unborn branch
submodule summary: do not fail before the first commit
git-submodule.sh | patch | blob | history |
diff --git a/git-submodule.sh b/git-submodule.sh
index f21d0bfce7020edeaed8c0066760e5f55e7facb9..2dd372a21d82a109774e80e014f9959485202b3e 100755 (executable)
--- a/git-submodule.sh
+++ b/git-submodule.sh
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 </dev/null)
+ test -z "$1" || shift
else
head="HEAD"
fi