#define USE_THE_REPOSITORY_VARIABLE
#include "git-compat-util.h"
#include "dir.h"
#include "environment.h"
#include "gettext.h"
#include "hex.h"
#include "path.h"
#include "repository.h"
#include "config.h"
#include "submodule-config.h"
#include "submodule.h"
#include "strbuf.h"
#include "object-name.h"
#include "object-store-ll.h"
#include "parse-options.h"
#include "thread-utils.h"
#include "tree-walk.h"
#include "url.h"
#include "urlmatch.h"
struct submodule_cache { … };
struct submodule_entry { … };
enum lookup_type { … };
static int config_path_cmp(const void *cmp_data UNUSED,
const struct hashmap_entry *eptr,
const struct hashmap_entry *entry_or_key,
const void *keydata UNUSED)
{ … }
static int config_name_cmp(const void *cmp_data UNUSED,
const struct hashmap_entry *eptr,
const struct hashmap_entry *entry_or_key,
const void *keydata UNUSED)
{ … }
static struct submodule_cache *submodule_cache_alloc(void)
{ … }
static void submodule_cache_init(struct submodule_cache *cache)
{ … }
static void free_one_config(struct submodule_entry *entry)
{ … }
static void submodule_cache_clear(struct submodule_cache *cache)
{ … }
void submodule_cache_free(struct submodule_cache *cache)
{ … }
static unsigned int hash_oid_string(const struct object_id *oid,
const char *string)
{ … }
static void cache_put_path(struct submodule_cache *cache,
struct submodule *submodule)
{ … }
static void cache_remove_path(struct submodule_cache *cache,
struct submodule *submodule)
{ … }
static void cache_add(struct submodule_cache *cache,
struct submodule *submodule)
{ … }
static const struct submodule *cache_lookup_path(struct submodule_cache *cache,
const struct object_id *gitmodules_oid, const char *path)
{ … }
static struct submodule *cache_lookup_name(struct submodule_cache *cache,
const struct object_id *gitmodules_oid, const char *name)
{ … }
int check_submodule_name(const char *name)
{ … }
static int starts_with_dot_slash(const char *const path)
{ … }
static int starts_with_dot_dot_slash(const char *const path)
{ … }
static int submodule_url_is_relative(const char *url)
{ … }
static int count_leading_dotdots(const char *url, const char **out)
{ … }
static int url_to_curl_url(const char *url, const char **out)
{ … }
int check_submodule_url(const char *url)
{ … }
static int name_and_item_from_var(const char *var, struct strbuf *name,
struct strbuf *item)
{ … }
static struct submodule *lookup_or_create_by_name(struct submodule_cache *cache,
const struct object_id *gitmodules_oid, const char *name)
{ … }
static int parse_fetch_recurse(const char *opt, const char *arg,
int die_on_error)
{ … }
int parse_submodule_fetchjobs(const char *var, const char *value,
const struct key_value_info *kvi)
{ … }
int parse_fetch_recurse_submodules_arg(const char *opt, const char *arg)
{ … }
int option_fetch_parse_recurse_submodules(const struct option *opt,
const char *arg, int unset)
{ … }
static int parse_update_recurse(const char *opt, const char *arg,
int die_on_error)
{ … }
int parse_update_recurse_submodules_arg(const char *opt, const char *arg)
{ … }
static int parse_push_recurse(const char *opt, const char *arg,
int die_on_error)
{ … }
int parse_push_recurse_submodules_arg(const char *opt, const char *arg)
{ … }
static void warn_multiple_config(const struct object_id *treeish_name,
const char *name, const char *option)
{ … }
static void warn_command_line_option(const char *var, const char *value)
{ … }
struct parse_config_parameter { … };
static int parse_config(const char *var, const char *value,
const struct config_context *ctx UNUSED, void *data)
{ … }
static int gitmodule_oid_from_commit(const struct object_id *treeish_name,
struct object_id *gitmodules_oid,
struct strbuf *rev)
{ … }
static const struct submodule *config_from(struct submodule_cache *cache,
const struct object_id *treeish_name, const char *key,
enum lookup_type lookup_type)
{ … }
static void submodule_cache_check_init(struct repository *repo)
{ … }
static void config_from_gitmodules(config_fn_t fn, struct repository *repo, void *data)
{ … }
static int gitmodules_cb(const char *var, const char *value,
const struct config_context *ctx, void *data)
{ … }
void repo_read_gitmodules(struct repository *repo, int skip_if_read)
{ … }
void gitmodules_config_oid(const struct object_id *commit_oid)
{ … }
const struct submodule *submodule_from_name(struct repository *r,
const struct object_id *treeish_name,
const char *name)
{ … }
const struct submodule *submodule_from_path(struct repository *r,
const struct object_id *treeish_name,
const char *path)
{ … }
static void traverse_tree_submodules(struct repository *r,
const struct object_id *root_tree,
char *prefix,
const struct object_id *treeish_name,
struct submodule_entry_list *out)
{ … }
void submodules_of_tree(struct repository *r,
const struct object_id *treeish_name,
struct submodule_entry_list *out)
{ … }
void submodule_entry_list_release(struct submodule_entry_list *list)
{ … }
void submodule_free(struct repository *r)
{ … }
static int config_print_callback(const char *var, const char *value,
const struct config_context *ctx UNUSED,
void *cb_data)
{ … }
int print_config_from_gitmodules(struct repository *repo, const char *key)
{ … }
int config_set_in_gitmodules_file_gently(const char *key, const char *value)
{ … }
struct fetch_config { … };
static int gitmodules_fetch_config(const char *var, const char *value,
const struct config_context *ctx,
void *cb)
{ … }
void fetch_config_from_gitmodules(int *max_children, int *recurse_submodules)
{ … }
static int gitmodules_update_clone_config(const char *var, const char *value,
const struct config_context *ctx,
void *cb)
{ … }
void update_clone_config_from_gitmodules(int *max_jobs)
{ … }