Browse Source

git submodule summary: Handle HEAD as argument when on an unborn branch

When calling "git submodule summary HEAD" on an unborn branch the output
was empty even when it shouldn't have been ("git submodule summary"
without the HEAD argument prints the expected output since commit
"submodule summary: do not fail before the first commit").

This also fixes "git status" to emit the "Submodule changes to be
committed" section on an unborn branch when used with the
status.submodulesummary config option.

Signed-off-by: Jens Lehmann <Jens.Lehmann@web.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
maint
Jens Lehmann 15 years ago committed by Junio C Hamano
parent
commit
2ea6c2c9ab
  1. 1
      git-submodule.sh

1
git-submodule.sh

@ -561,6 +561,7 @@ cmd_summary() {
then then
# before the first commit: compare with an empty tree # before the first commit: compare with an empty tree
head=$(git hash-object -w -t tree --stdin </dev/null) head=$(git hash-object -w -t tree --stdin </dev/null)
test -z "$1" || shift
else else
head="HEAD" head="HEAD"
fi fi

Loading…
Cancel
Save