X-Git-Url: https://git.tokkee.org/?a=blobdiff_plain;f=git-submodule.sh;h=2dd372a21d82a109774e80e014f9959485202b3e;hb=c5ce1836719dc77e3c8495206653037cb5c4e511;hp=e2082fd1492fe34e69c59f0a46cbaf7ddd2e2a8e;hpb=970957dbad9361de75bf712cd2049853189b428f;p=git.git diff --git a/git-submodule.sh b/git-submodule.sh index e2082fd14..2dd372a21 100755 --- a/git-submodule.sh +++ b/git-submodule.sh @@ -553,12 +553,17 @@ cmd_summary() { test $summary_limit = 0 && return - if rev=$(git rev-parse -q --verify "$1^0") + if rev=$(git rev-parse -q --verify --default HEAD ${1+"$1"}) then head=$rev - shift + test $# = 0 || shift + elif test -z "$1" -o "$1" = "HEAD" + then + # before the first commit: compare with an empty tree + head=$(git hash-object -w -t tree --stdin