summaryrefslogtreecommitdiff
path: root/submodule.h
diff options
context:
space:
mode:
authorBrandon Williams <bmwill@google.com>2017-05-09 19:17:59 (GMT)
committerJunio C Hamano <gitster@pobox.com>2017-05-10 05:47:39 (GMT)
commitbdab972153a73815e04e9699406433e409ed28ab (patch)
tree0f6210c3fbab3473680f3459cf69d498e0ea6319 /submodule.h
parent2c3b40799fcdb9d2dedc90134e4f3841af08bbe7 (diff)
downloadgit-bdab972153a73815e04e9699406433e409ed28ab.zip
git-bdab972153a73815e04e9699406433e409ed28ab.tar.gz
git-bdab972153a73815e04e9699406433e409ed28ab.tar.bz2
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>
Diffstat (limited to 'submodule.h')
-rw-r--r--submodule.h2
1 files changed, 2 insertions, 0 deletions
diff --git a/submodule.h b/submodule.h
index 1277480..d11b4da 100644
--- a/submodule.h
+++ b/submodule.h
@@ -49,6 +49,8 @@ extern int is_submodule_initialized(const char *path);
* Otherwise the return error code is the same as of resolve_gitdir_gently.
*/
extern int is_submodule_populated_gently(const char *path, int *return_error_code);
+extern void die_in_unpopulated_submodule(const struct index_state *istate,
+ const char *prefix);
extern int parse_submodule_update_strategy(const char *value,
struct submodule_update_strategy *dst);
extern const char *submodule_strategy_to_string(const struct submodule_update_strategy *s);