Skip to content

Commit

Permalink
git submodule summary: Handle HEAD as argument when on an unborn branch
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Jens Lehmann authored and Junio C Hamano committed Mar 10, 2010
1 parent 14e940d commit 2ea6c2c
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions git-submodule.sh
Original file line number Diff line number Diff line change
Expand Up @@ -561,6 +561,7 @@ cmd_summary() {
then
# 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
Expand Down

0 comments on commit 2ea6c2c

Please sign in to comment.