From: Junio C Hamano Date: Thu, 20 Apr 2017 04:37:19 +0000 (-0700) Subject: Merge branch 'nd/files-backend-git-dir' X-Git-Tag: v2.13.0-rc0~9 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=5ab8f2261fa2b595abe433dd50be0f2aaec14aa0;p=thirdparty%2Fgit.git Merge branch 'nd/files-backend-git-dir' The "submodule" specific field in the ref_store structure is replaced with a more generic "gitdir" that can later be used also when dealing with ref_store that represents the set of refs visible from the other worktrees. * nd/files-backend-git-dir: (28 commits) refs.h: add a note about sorting order of for_each_ref_* t1406: new tests for submodule ref store t1405: some basic tests on main ref store t/helper: add test-ref-store to test ref-store functions refs: delete pack_refs() in favor of refs_pack_refs() files-backend: avoid ref api targeting main ref store refs: new transaction related ref-store api refs: add new ref-store api refs: rename get_ref_store() to get_submodule_ref_store() and make it public files-backend: replace submodule_allowed check in files_downcast() refs: move submodule code out of files-backend.c path.c: move some code out of strbuf_git_path_submodule() refs.c: make get_main_ref_store() public and use it refs.c: kill register_ref_store(), add register_submodule_ref_store() refs.c: flatten get_ref_store() a bit refs: rename lookup_ref_store() to lookup_submodule_ref_store() refs.c: introduce get_main_ref_store() files-backend: remove the use of git_path() files-backend: add and use files_ref_path() files-backend: add and use files_reflog_path() ... --- 5ab8f2261fa2b595abe433dd50be0f2aaec14aa0 diff --cc submodule.h index 486371d2c3,fce2fb64d2..1277480add --- a/submodule.h +++ b/submodule.h @@@ -98,14 -81,13 +98,20 @@@ extern int push_unpushed_submodules(str int dry_run); extern void connect_work_tree_and_git_dir(const char *work_tree, const char *git_dir); extern int parallel_submodules(void); + /* + * Given a submodule path (as in the index), return the repository + * path of that submodule in 'buf'. Return -1 on error or when the + * submodule is not initialized. + */ + int submodule_to_gitdir(struct strbuf *buf, const char *submodule); +#define SUBMODULE_MOVE_HEAD_DRY_RUN (1<<0) +#define SUBMODULE_MOVE_HEAD_FORCE (1<<1) +extern int submodule_move_head(const char *path, + const char *old, + const char *new, + unsigned flags); + /* * Prepare the "env_array" parameter of a "struct child_process" for executing * a submodule by clearing any repo-specific envirionment variables, but