blob: 7beec4822b9a35a6286a303f6cf877be1c734568 [file] [log] [blame]
Johannes Schindelin752c0c22009-10-19 14:38:32 +02001#ifndef SUBMODULE_H
2#define SUBMODULE_H
3
Jens Lehmann46a958b2010-06-25 16:56:47 +02004struct diff_options;
Jens Lehmann50d89ad2012-09-01 17:27:06 +02005struct argv_array;
Jens Lehmann46a958b2010-06-25 16:56:47 +02006
Jens Lehmann88a21972011-03-06 23:10:46 +01007enum {
8 RECURSE_SUBMODULES_ON_DEMAND = -1,
9 RECURSE_SUBMODULES_OFF = 0,
10 RECURSE_SUBMODULES_DEFAULT = 1,
11 RECURSE_SUBMODULES_ON = 2
12};
13
Jens Lehmann5fee9952013-07-30 21:50:34 +020014int is_staging_gitmodules_ok(void);
Jens Lehmann06567812013-08-06 21:15:11 +020015int update_path_in_gitmodules(const char *oldpath, const char *newpath);
Jens Lehmann95c16412013-08-06 21:15:25 +020016int remove_path_from_gitmodules(const char *path);
Jens Lehmann5fee9952013-07-30 21:50:34 +020017void stage_updated_gitmodules(void);
Jens Lehmannaee9c7d2010-08-06 00:39:25 +020018void set_diffopt_flags_from_submodule_config(struct diff_options *diffopt,
19 const char *path);
Jens Lehmann7dce19d2010-11-12 13:54:52 +010020int submodule_config(const char *var, const char *value, void *cb);
René Scharfec2df7582012-04-10 21:10:26 +020021void gitmodules_config(void);
Jens Lehmannaee9c7d2010-08-06 00:39:25 +020022int parse_submodule_config_option(const char *var, const char *value);
Jens Lehmann46a958b2010-06-25 16:56:47 +020023void handle_ignore_submodules_arg(struct diff_options *diffopt, const char *);
Jens Lehmann88a21972011-03-06 23:10:46 +010024int parse_fetch_recurse_submodules_arg(const char *opt, const char *arg);
Johannes Schindelin752c0c22009-10-19 14:38:32 +020025void show_submodule_summary(FILE *f, const char *path,
John Keeping0f33a062013-04-05 17:12:08 +010026 const char *line_prefix,
Johannes Schindelin752c0c22009-10-19 14:38:32 +020027 unsigned char one[20], unsigned char two[20],
Ramkumar Ramachandra4e215132012-11-13 21:12:47 +053028 unsigned dirty_submodule, const char *meta,
Johannes Schindelin752c0c22009-10-19 14:38:32 +020029 const char *del, const char *add, const char *reset);
Jens Lehmannbe254a02010-11-11 00:55:02 +010030void set_config_fetch_recurse_submodules(int value);
Jens Lehmann88a21972011-03-06 23:10:46 +010031void check_for_new_submodule_commits(unsigned char new_sha1[20]);
Jens Lehmann50d89ad2012-09-01 17:27:06 +020032int fetch_populated_submodules(const struct argv_array *options,
Jens Lehmann8f0700d2011-03-06 23:11:21 +010033 const char *prefix, int command_line_option,
Jens Lehmannbe254a02010-11-11 00:55:02 +010034 int quiet);
Jens Lehmann3bfc4502010-03-13 23:00:27 +010035unsigned is_submodule_modified(const char *path, int ignore_untracked);
Jens Lehmann293ab152012-09-26 20:21:13 +020036int submodule_uses_gitfile(const char *path);
37int ok_to_remove_submodule(const char *path);
Heiko Voigt68d03e42010-07-07 15:39:13 +020038int merge_submodule(unsigned char result[20], const char *path, const unsigned char base[20],
Brad King80988782011-10-13 08:59:05 -040039 const unsigned char a[20], const unsigned char b[20], int search);
Heiko Voigta762e512012-03-29 09:21:23 +020040int find_unpushed_submodules(unsigned char new_sha1[20], const char *remotes_name,
41 struct string_list *needs_pushing);
Heiko Voigteb21c732012-03-29 09:21:24 +020042int push_unpushed_submodules(unsigned char new_sha1[20], const char *remotes_name);
Jens Lehmanna88c9152013-07-30 21:50:03 +020043void connect_work_tree_and_git_dir(const char *work_tree, const char *git_dir);
Johannes Schindelin752c0c22009-10-19 14:38:32 +020044
45#endif