Merge branch 'rr/maint-submodule-unknown-cmd'
* rr/maint-submodule-unknown-cmd: submodule: if $command was not matched, don't parse other args
This commit is contained in:
@ -112,7 +112,6 @@ status::
|
|||||||
initialized, `+` if the currently checked out submodule commit
|
initialized, `+` if the currently checked out submodule commit
|
||||||
does not match the SHA-1 found in the index of the containing
|
does not match the SHA-1 found in the index of the containing
|
||||||
repository and `U` if the submodule has merge conflicts.
|
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
|
If `--recursive` is specified, this command will recurse into nested
|
||||||
submodules, and show their status as well.
|
submodules, and show their status as well.
|
||||||
|
|||||||
@ -1107,7 +1107,15 @@ do
|
|||||||
done
|
done
|
||||||
|
|
||||||
# No command word defaults to "status"
|
# 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"
|
# "-b branch" is accepted only by "add"
|
||||||
if test -n "$branch" && test "$command" != add
|
if test -n "$branch" && test "$command" != add
|
||||||
|
|||||||
@ -438,8 +438,8 @@ test_expect_success 'moving to a commit without submodule does not leave empty d
|
|||||||
git checkout second
|
git checkout second
|
||||||
'
|
'
|
||||||
|
|
||||||
test_expect_success 'submodule <invalid-path> warns' '
|
test_expect_success 'submodule <invalid-subcommand> fails' '
|
||||||
test_failure_with_unknown_submodule
|
test_must_fail git submodule no-such-subcommand
|
||||||
'
|
'
|
||||||
|
|
||||||
test_expect_success 'add submodules without specifying an explicit path' '
|
test_expect_success 'add submodules without specifying an explicit path' '
|
||||||
|
|||||||
Reference in New Issue
Block a user