diff options
author | Junio C Hamano <gitster@pobox.com> | 2012-09-29 22:28:32 -0700 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2012-09-29 22:28:33 -0700 |
commit | da5a2bd525400b9106dfdccc61e2079a97589a0d (patch) | |
tree | 0570db7805ae7626487ba9e5e3851a287386a081 | |
parent | Merge branch 'rs/archive-zip-utf8' (diff) | |
parent | submodule: if $command was not matched, don't parse other args (diff) | |
download | tgif-da5a2bd525400b9106dfdccc61e2079a97589a0d.tar.xz |
Merge branch 'rr/maint-submodule-unknown-cmd'
* rr/maint-submodule-unknown-cmd:
submodule: if $command was not matched, don't parse other args
-rw-r--r-- | Documentation/git-submodule.txt | 1 | ||||
-rwxr-xr-x | git-submodule.sh | 10 | ||||
-rwxr-xr-x | t/t7400-submodule-basic.sh | 4 |
3 files changed, 11 insertions, 4 deletions
diff --git a/Documentation/git-submodule.txt b/Documentation/git-submodule.txt index 2de7bf0900..b4683bba1b 100644 --- a/Documentation/git-submodule.txt +++ b/Documentation/git-submodule.txt @@ -112,7 +112,6 @@ status:: initialized, `+` if the currently checked out submodule commit does not match the SHA-1 found in the index of the containing repository and `U` if the submodule has merge conflicts. - This command is the default command for 'git submodule'. + If `--recursive` is specified, this command will recurse into nested submodules, and show their status as well. diff --git a/git-submodule.sh b/git-submodule.sh index 3e2045e52d..ab6b1107b6 100755 --- a/git-submodule.sh +++ b/git-submodule.sh @@ -1107,7 +1107,15 @@ do done # No command word defaults to "status" -test -n "$command" || command=status +if test -z "$command" +then + if test $# = 0 + then + command=status + else + usage + fi +fi # "-b branch" is accepted only by "add" if test -n "$branch" && test "$command" != add diff --git a/t/t7400-submodule-basic.sh b/t/t7400-submodule-basic.sh index 56a81cd748..5397037491 100755 --- a/t/t7400-submodule-basic.sh +++ b/t/t7400-submodule-basic.sh @@ -438,8 +438,8 @@ test_expect_success 'moving to a commit without submodule does not leave empty d git checkout second ' -test_expect_success 'submodule <invalid-path> warns' ' - test_failure_with_unknown_submodule +test_expect_success 'submodule <invalid-subcommand> fails' ' + test_must_fail git submodule no-such-subcommand ' test_expect_success 'add submodules without specifying an explicit path' ' |