Browse Source

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>
maint
Johannes Schindelin 16 years ago committed by Junio C Hamano
parent
commit
496917b721
  1. 2
      git-submodule.sh
  2. 7
      t/t7400-submodule-basic.sh

2
git-submodule.sh

@ -59,7 +59,7 @@ resolve_relative_url () @@ -59,7 +59,7 @@ resolve_relative_url ()
#
module_list()
{
git ls-files --stage -- "$@" | grep '^160000 '
git ls-files --error-unmatch --stage -- "$@" | grep '^160000 '
}

#

7
t/t7400-submodule-basic.sh

@ -240,4 +240,11 @@ test_expect_success 'ls-files gracefully handles trailing slash' ' @@ -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

Loading…
Cancel
Save