]> git.ipfire.org Git - thirdparty/git.git/commitdiff
Merge branch 'jh/maint-submodule-status-in-void'
authorJunio C Hamano <gitster@pobox.com>
Wed, 24 Mar 2010 23:55:37 +0000 (16:55 -0700)
committerJunio 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.sh

index f21d0bfce7020edeaed8c0066760e5f55e7facb9..2dd372a21d82a109774e80e014f9959485202b3e 100755 (executable)
@@ -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