diff options
Diffstat (limited to 'submodule.h')
-rw-r--r-- | submodule.h | 22 |
1 files changed, 15 insertions, 7 deletions
diff --git a/submodule.h b/submodule.h index 7d476cefa7..4dad649f94 100644 --- a/submodule.h +++ b/submodule.h @@ -40,6 +40,7 @@ struct submodule_update_strategy { #define SUBMODULE_UPDATE_STRATEGY_INIT {SM_UPDATE_UNSPECIFIED, NULL} int is_gitmodules_unmerged(const struct index_state *istate); +int is_writing_gitmodules_ok(void); int is_staging_gitmodules_ok(struct index_state *istate); int update_path_in_gitmodules(const char *oldpath, const char *newpath); int remove_path_from_gitmodules(const char *path); @@ -102,13 +103,16 @@ int add_submodule_odb(const char *path); * Checks if there are submodule changes in a..b. If a is the null OID, * checks b and all its ancestors instead. */ -int submodule_touches_in_range(struct object_id *a, +int submodule_touches_in_range(struct repository *r, + struct object_id *a, struct object_id *b); -int find_unpushed_submodules(struct oid_array *commits, +int find_unpushed_submodules(struct repository *r, + struct oid_array *commits, const char *remotes_name, struct string_list *needs_pushing); struct refspec; -int push_unpushed_submodules(struct oid_array *commits, +int push_unpushed_submodules(struct repository *r, + struct oid_array *commits, const struct remote *remote, const struct refspec *rs, const struct string_list *push_options, @@ -120,6 +124,11 @@ int push_unpushed_submodules(struct oid_array *commits, */ int submodule_to_gitdir(struct strbuf *buf, const char *submodule); +/* + * Make sure that no submodule's git dir is nested in a sibling submodule's. + */ +int validate_submodule_git_dir(char *git_dir, const char *submodule_name); + #define SUBMODULE_MOVE_HEAD_DRY_RUN (1<<0) #define SUBMODULE_MOVE_HEAD_FORCE (1<<1) int submodule_move_head(const char *path, @@ -137,15 +146,14 @@ void submodule_unset_core_worktree(const struct submodule *sub); void prepare_submodule_repo_env(struct argv_array *out); #define ABSORB_GITDIR_RECURSE_SUBMODULES (1<<0) -void absorb_git_dir_into_superproject(const char *prefix, - const char *path, +void absorb_git_dir_into_superproject(const char *path, unsigned flags); /* * Return the absolute path of the working tree of the superproject, which this * project is a submodule of. If this repository is not a submodule of - * another repository, return NULL. + * another repository, return 0. */ -const char *get_superproject_working_tree(void); +int get_superproject_working_tree(struct strbuf *buf); #endif |