aboutsummaryrefslogtreecommitdiff
path: root/git-submodule.sh
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2010-03-02 12:44:07 -0800
committerJunio C Hamano <gitster@pobox.com>2010-03-02 12:44:07 -0800
commit490b8ad76fec278be532b893d2b5b6df9a621bec (patch)
treef893f31a2b4d11f86d51ec9ada900096b3d1ad0e /git-submodule.sh
parent39914cb50693e6fbc3002bbc30366e25fe6beca2 (diff)
parent3deea89c5feb0dfdfb99ea752f83497d97a3bdd5 (diff)
downloadgit-490b8ad76fec278be532b893d2b5b6df9a621bec.tar.xz
Merge branch 'jh/maint-submodule-status-in-void'
* jh/maint-submodule-status-in-void: submodule summary: Don't barf when invoked in an empty repo
Diffstat (limited to 'git-submodule.sh')
-rwxr-xr-xgit-submodule.sh7
1 files changed, 5 insertions, 2 deletions
diff --git a/git-submodule.sh b/git-submodule.sh
index 664f21721c..5869c00f2d 100755
--- a/git-submodule.sh
+++ b/git-submodule.sh
@@ -553,12 +553,15 @@ 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
+ elif test -z "$1" -o "$1" = "HEAD"
+ then
+ return
else
- head=HEAD
+ head="HEAD"
fi
if [ -n "$files" ]