summaryrefslogtreecommitdiff
path: root/git-submodule.sh
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2010-03-24 16:55:37 -0700
committerJunio C Hamano <gitster@pobox.com>2010-03-24 16:55:37 -0700
commit5e4f61474202122f376b16181b760f390623bf4e (patch)
tree9a440f603cda4135927265adba91a39da30e5940 /git-submodule.sh
parenta86ed83cce0fc0b9a9fe4e17ac1bf4f719028d20 (diff)
parent2ea6c2c9ab6555cbd48ca017bf5027162707a0b1 (diff)
downloadgit-5e4f61474202122f376b16181b760f390623bf4e.tar.gz
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
Diffstat (limited to 'git-submodule.sh')
-rwxr-xr-xgit-submodule.sh4
1 files changed, 3 insertions, 1 deletions
diff --git a/git-submodule.sh b/git-submodule.sh
index f21d0bfce7..2dd372a21d 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