THIS IS A TEST INSTANCE ONLY! REPOSITORIES CAN BE DELETED AT ANY TIME!

Git Source Code Mirror - This is a publish-only repository and all pull requests are ignored. Please follow Documentation/SubmittingPatches procedure for any of your improvements.
git
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

73 lines
2.4KB

  1. #ifndef SUBMODULE_CONFIG_CACHE_H
  2. #define SUBMODULE_CONFIG_CACHE_H
  3. #include "cache.h"
  4. #include "config.h"
  5. #include "hashmap.h"
  6. #include "submodule.h"
  7. #include "strbuf.h"
  8. /*
  9. * Submodule entry containing the information about a certain submodule
  10. * in a certain revision.
  11. */
  12. struct submodule {
  13. const char *path;
  14. const char *name;
  15. const char *url;
  16. int fetch_recurse;
  17. const char *ignore;
  18. const char *branch;
  19. struct submodule_update_strategy update_strategy;
  20. /* the object id of the responsible .gitmodules file */
  21. struct object_id gitmodules_oid;
  22. int recommend_shallow;
  23. };
  24. #define SUBMODULE_INIT { NULL, NULL, NULL, RECURSE_SUBMODULES_NONE, \
  25. NULL, NULL, SUBMODULE_UPDATE_STRATEGY_INIT, { { 0 } }, -1 };
  26. struct submodule_cache;
  27. struct repository;
  28. void submodule_cache_free(struct submodule_cache *cache);
  29. int parse_submodule_fetchjobs(const char *var, const char *value);
  30. int parse_fetch_recurse_submodules_arg(const char *opt, const char *arg);
  31. struct option;
  32. int option_fetch_parse_recurse_submodules(const struct option *opt,
  33. const char *arg, int unset);
  34. int parse_update_recurse_submodules_arg(const char *opt, const char *arg);
  35. int parse_push_recurse_submodules_arg(const char *opt, const char *arg);
  36. void repo_read_gitmodules(struct repository *repo);
  37. void gitmodules_config_oid(const struct object_id *commit_oid);
  38. const struct submodule *submodule_from_name(struct repository *r,
  39. const struct object_id *commit_or_tree,
  40. const char *name);
  41. const struct submodule *submodule_from_path(struct repository *r,
  42. const struct object_id *commit_or_tree,
  43. const char *path);
  44. void submodule_free(struct repository *r);
  45. int print_config_from_gitmodules(struct repository *repo, const char *key);
  46. int config_set_in_gitmodules_file_gently(const char *key, const char *value);
  47. /*
  48. * Returns 0 if the name is syntactically acceptable as a submodule "name"
  49. * (e.g., that may be found in the subsection of a .gitmodules file) and -1
  50. * otherwise.
  51. */
  52. int check_submodule_name(const char *name);
  53. /*
  54. * Note: these helper functions exist solely to maintain backward
  55. * compatibility with 'fetch' and 'update_clone' storing configuration in
  56. * '.gitmodules'.
  57. *
  58. * New helpers to retrieve arbitrary configuration from the '.gitmodules' file
  59. * should NOT be added.
  60. */
  61. void fetch_config_from_gitmodules(int *max_children, int *recurse_submodules);
  62. void update_clone_config_from_gitmodules(int *max_jobs);
  63. #endif /* SUBMODULE_CONFIG_H */