diff options
author | Stefan Beller <sbeller@google.com> | 2016-02-29 18:07:11 -0800 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2016-03-01 11:57:17 -0800 |
commit | ea2fa5a3388281b880ae2aa75c8eac0d4b1a6c69 (patch) | |
tree | 58f08091493d1d942a21f04ee6f7b8219f4224bf /submodule.h | |
parent | run-command: do not pass child process data into callbacks (diff) | |
download | tgif-ea2fa5a3388281b880ae2aa75c8eac0d4b1a6c69.tar.xz |
submodule-config: keep update strategy around
Currently submodule.<name>.update is only handled by git-submodule.sh.
C code will start to need to make use of that value as more of the
functionality of git-submodule.sh moves into library code in C.
Add the update field to 'struct submodule' and populate it so it can
be read as sm->update or from sm->update_command.
Reviewed-by: Jonathan Nieder <jrnieder@gmail.com>
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 | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/submodule.h b/submodule.h index cbc000304e..3464500629 100644 --- a/submodule.h +++ b/submodule.h @@ -13,6 +13,20 @@ enum { RECURSE_SUBMODULES_ON = 2 }; +enum submodule_update_type { + SM_UPDATE_UNSPECIFIED = 0, + SM_UPDATE_CHECKOUT, + SM_UPDATE_REBASE, + SM_UPDATE_MERGE, + SM_UPDATE_NONE, + SM_UPDATE_COMMAND +}; + +struct submodule_update_strategy { + enum submodule_update_type type; + const char *command; +}; + int is_staging_gitmodules_ok(void); int update_path_in_gitmodules(const char *oldpath, const char *newpath); int remove_path_from_gitmodules(const char *path); @@ -21,6 +35,8 @@ void set_diffopt_flags_from_submodule_config(struct diff_options *diffopt, const char *path); int submodule_config(const char *var, const char *value, void *cb); void gitmodules_config(void); +int parse_submodule_update_strategy(const char *value, + struct submodule_update_strategy *dst); void handle_ignore_submodules_arg(struct diff_options *diffopt, const char *); void show_submodule_summary(FILE *f, const char *path, const char *line_prefix, |