diff options
author | Jens Lehmann <Jens.Lehmann@web.de> | 2013-07-30 21:50:03 +0200 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2013-07-30 13:52:53 -0700 |
commit | a88c915de9886fe17005a5daff4900ced0ea76ad (patch) | |
tree | 3a969c58914c856210aa9e4770c66d2e7959a316 /submodule.h | |
parent | 11502468287fdd62a22c43766881d21ab4fcf31c (diff) | |
download | git-a88c915de9886fe17005a5daff4900ced0ea76ad.tar.gz |
mv: move submodules using a gitfile
When moving a submodule which uses a gitfile to point to the git directory
stored in .git/modules/<name> of the superproject two changes must be made
to make the submodule work: the .git file and the core.worktree setting
must be adjusted to point from work tree to git directory and back.
Achieve that by remembering which submodule uses a gitfile by storing the
result of read_gitfile() of each submodule. If that is not NULL the new
function connect_work_tree_and_git_dir() is called after renaming the
submodule's work tree which updates the two settings to the new values.
Extend the man page to inform the user about that feature (and while at it
change the description to not talk about a script anymore, as mv is a
builtin for quite some time now).
Signed-off-by: Jens Lehmann <Jens.Lehmann@web.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'submodule.h')
-rw-r--r-- | submodule.h | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/submodule.h b/submodule.h index c7ffc7c399..29e9658980 100644 --- a/submodule.h +++ b/submodule.h @@ -36,5 +36,6 @@ int merge_submodule(unsigned char result[20], const char *path, const unsigned c int find_unpushed_submodules(unsigned char new_sha1[20], const char *remotes_name, struct string_list *needs_pushing); int push_unpushed_submodules(unsigned char new_sha1[20], const char *remotes_name); +void connect_work_tree_and_git_dir(const char *work_tree, const char *git_dir); #endif |