diff options
author | Stefan Beller <sbeller@google.com> | 2017-03-14 14:46:37 -0700 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2017-03-16 14:07:16 -0700 |
commit | 6e3c1595c66e2b192a2a516447c5645814766339 (patch) | |
tree | 918c43a29b77a93f1a207c7998f7bdc5e4637fcb /submodule.h | |
parent | 202275b96b6c3ffc2c380cfb017e4f6a0dd6bddb (diff) | |
download | git-6e3c1595c66e2b192a2a516447c5645814766339.tar.gz |
update submodules: add submodule_move_head
In later patches we introduce the options and flag for commands
that modify the working directory, e.g. git-checkout.
This piece of code will be used universally for
all these working tree modifications as it
* supports dry run to answer the question:
"Is it safe to change the submodule to this new state?"
e.g. is it overwriting untracked files or are there local
changes that would be overwritten?
* supports a force flag that can be used for resetting
the tree.
Signed-off-by: Stefan Beller <sbeller@google.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'submodule.h')
-rw-r--r-- | submodule.h | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/submodule.h b/submodule.h index 6f3fe85c7c..4cdf6445f7 100644 --- a/submodule.h +++ b/submodule.h @@ -96,6 +96,13 @@ extern int push_unpushed_submodules(struct sha1_array *commits, extern void connect_work_tree_and_git_dir(const char *work_tree, const char *git_dir); extern int parallel_submodules(void); +#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 |