diff options
author | Johannes Schindelin <johannes.schindelin@gmx.de> | 2009-02-07 14:43:15 +0100 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2009-02-07 12:49:58 -0800 |
commit | 496917b721adae11e596cd44b13cb8a49c388de7 (patch) | |
tree | 4d6be3ccbbf938eb523fb62cbcd21297d33056b8 | |
parent | Let ls-files strip trailing slashes in submodules' paths (diff) | |
download | tgif-496917b721adae11e596cd44b13cb8a49c388de7.tar.xz |
submodule: warn about non-submodules
Earlier, when you called
git submodule some/bogus/path
Git would silently ignore the path, without warning the user about the
likely mistake. Now it does.
Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
-rwxr-xr-x | git-submodule.sh | 2 | ||||
-rwxr-xr-x | t/t7400-submodule-basic.sh | 7 |
2 files changed, 8 insertions, 1 deletions
diff --git a/git-submodule.sh b/git-submodule.sh index 2f47e065fe..6cc2d334c0 100755 --- a/git-submodule.sh +++ b/git-submodule.sh @@ -59,7 +59,7 @@ resolve_relative_url () # module_list() { - git ls-files --stage -- "$@" | grep '^160000 ' + git ls-files --error-unmatch --stage -- "$@" | grep '^160000 ' } # diff --git a/t/t7400-submodule-basic.sh b/t/t7400-submodule-basic.sh index a74f24c0db..b8cb2df667 100755 --- a/t/t7400-submodule-basic.sh +++ b/t/t7400-submodule-basic.sh @@ -240,4 +240,11 @@ test_expect_success 'ls-files gracefully handles trailing slash' ' ' +test_expect_success 'submodule <invalid-path> warns' ' + + git submodule no-such-submodule 2> output.err && + grep "^error: .*no-such-submodule" output.err + +' + test_done |