Skip to content

Commit

Permalink
submodule: warn about non-submodules
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Johannes Schindelin authored and Junio C Hamano committed Feb 7, 2009
1 parent f3670a5 commit 496917b
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
2 changes: 1 addition & 1 deletion git-submodule.sh
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ resolve_relative_url ()
#
module_list()
{
git ls-files --stage -- "$@" | grep '^160000 '
git ls-files --error-unmatch --stage -- "$@" | grep '^160000 '
}

#
Expand Down
7 changes: 7 additions & 0 deletions t/t7400-submodule-basic.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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

0 comments on commit 496917b

Please sign in to comment.