Skip to content

Commit 2ea6c2c

Browse files
jlehmanngitster
authored andcommitted
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 <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent 14e940d commit 2ea6c2c

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

git-submodule.sh

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -561,6 +561,7 @@ cmd_summary() {
561561
then
562562
# before the first commit: compare with an empty tree
563563
head=$(git hash-object -w -t tree --stdin </dev/null)
564+
test -z "$1" || shift
564565
else
565566
head="HEAD"
566567
fi

0 commit comments

Comments
 (0)