submodule: add die_in_unpopulated_submodule function
commitbdab972153a73815e04e9699406433e409ed28ab
authorBrandon Williams <bmwill@google.com>
Tue, 9 May 2017 19:17:59 +0000 (9 12:17 -0700)
committerJunio C Hamano <gitster@pobox.com>
Wed, 10 May 2017 05:47:39 +0000 (10 14:47 +0900)
tree0f6210c3fbab3473680f3459cf69d498e0ea6319
parent2c3b40799fcdb9d2dedc90134e4f3841af08bbe7
submodule: add die_in_unpopulated_submodule function

Currently 'git add' is the only command which dies when launched from an
unpopulated submodule (the place-holder directory for a submodule which
hasn't been checked out).  This is triggered implicitly by passing the
PATHSPEC_STRIP_SUBMODULE_SLASH_EXPENSIVE flag to 'parse_pathspec()'.

Instead make this desire more explicit by creating a function
'die_in_unpopulated_submodule()' which dies if the provided 'prefix' has
a leading path component which matches a submodule in the the index.

Signed-off-by: Brandon Williams <bmwill@google.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
builtin/add.c
pathspec.c
submodule.c
submodule.h
t/t6134-pathspec-in-submodule.sh