summaryrefslogtreecommitdiff
path: root/submodule.h
diff options
context:
space:
mode:
authorStefan Beller <sbeller@google.com>2016-03-01 02:07:11 (GMT)
committerJunio C Hamano <gitster@pobox.com>2016-03-01 19:57:17 (GMT)
commitea2fa5a3388281b880ae2aa75c8eac0d4b1a6c69 (patch)
tree58f08091493d1d942a21f04ee6f7b8219f4224bf /submodule.h
parent2a73b3dad09ef162eb5917e9e0d01d7c306f6b35 (diff)
downloadgit-ea2fa5a3388281b880ae2aa75c8eac0d4b1a6c69.zip
git-ea2fa5a3388281b880ae2aa75c8eac0d4b1a6c69.tar.gz
git-ea2fa5a3388281b880ae2aa75c8eac0d4b1a6c69.tar.bz2
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.h16
1 files changed, 16 insertions, 0 deletions
diff --git a/submodule.h b/submodule.h
index cbc0003..3464500 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,