author | Johan Herland <johan@herland.net> | |
Tue, 16 Feb 2010 10:21:14 +0000 (11:21 +0100) | ||
committer | Junio C Hamano <gitster@pobox.com> | |
Wed, 17 Feb 2010 19:14:04 +0000 (11:14 -0800) | ||
commit | 3deea89c5feb0dfdfb99ea752f83497d97a3bdd5 | |
tree | d44dac620a12cedcc1e8c73724b166ff35423a78 | tree | snapshot |
parent | e923eaeb901ff056421b9007adcbbce271caa7b6 | commit | diff |
submodule summary: Don't barf when invoked in an empty repo
When invoking "git submodule summary" in an empty repo (which can be
indirectly done by setting status.submodulesummary = true), it currently
emits an error message (via "git diff-index") since HEAD points to an
unborn branch.
This patch adds handling of the HEAD-points-to-unborn-branch special case,
so that "git submodule summary" no longer emits this error message.
The patch also adds a test case that verifies the fix.
Suggested-by: Jeff King <peff@peff.net>
Signed-off-by: Johan Herland <johan@herland.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
When invoking "git submodule summary" in an empty repo (which can be
indirectly done by setting status.submodulesummary = true), it currently
emits an error message (via "git diff-index") since HEAD points to an
unborn branch.
This patch adds handling of the HEAD-points-to-unborn-branch special case,
so that "git submodule summary" no longer emits this error message.
The patch also adds a test case that verifies the fix.
Suggested-by: Jeff King <peff@peff.net>
Signed-off-by: Johan Herland <johan@herland.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
git-submodule.sh | diff | blob | history | |
t/t7401-submodule-summary.sh | diff | blob | history |