@matheusbsbs / matheus-bagliano / commits / 496917b721
Fork 0

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>

Johannes Schindelin committed Feb 7, 2009 at 14:43 UTC 496917b721adae11e596cd44b13cb8a49c388de7
2 files changed +8 -1
git-submodule.sh
+1 -1
@@ -59,7 +59,7 @@ resolve_relative_url ()
59 #
60 module_list()
61 {
62 - git ls-files --stage -- "$@" | grep '^160000 '
62 + git ls-files --error-unmatch --stage -- "$@" | grep '^160000 '
63 }
64
65 #
t/t7400-submodule-basic.sh
+7
@@ -240,4 +240,11 @@ test_expect_success 'ls-files gracefully handles trailing slash' '
240
241 '
242
243 +test_expect_success 'submodule <invalid-path> warns' '
244 +
245 + git submodule no-such-submodule 2> output.err &&
246 + grep "^error: .*no-such-submodule" output.err
247 +
248 +'
249 +
250 test_done