summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2010-03-24 23:55:37 (GMT)
committerJunio C Hamano <gitster@pobox.com>2010-03-24 23:55:37 (GMT)
commit5e4f61474202122f376b16181b760f390623bf4e (patch)
tree9a440f603cda4135927265adba91a39da30e5940
parenta86ed83cce0fc0b9a9fe4e17ac1bf4f719028d20 (diff)
parent2ea6c2c9ab6555cbd48ca017bf5027162707a0b1 (diff)
downloadgit-5e4f61474202122f376b16181b760f390623bf4e.zip
git-5e4f61474202122f376b16181b760f390623bf4e.tar.gz
git-5e4f61474202122f376b16181b760f390623bf4e.tar.bz2
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
-rwxr-xr-xgit-submodule.sh4
1 files changed, 3 insertions, 1 deletions
diff --git a/git-submodule.sh b/git-submodule.sh
index f21d0bf..2dd372a 100755
--- a/git-submodule.sh
+++ b/git-submodule.sh
@@ -559,7 +559,9 @@ 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 </dev/null)
+ test -z "$1" || shift
else
head="HEAD"
fi