Merge branch 'sb/submodule-move-nested'
Moving a submodule that itself has submodule in it with "git mv"
forgot to make necessary adjustment to the nested sub-submodules;
now the codepath learned to recurse into the submodules.
* sb/submodule-move-nested:
submodule: fixup nested submodules after moving the submodule
submodule-config: remove submodule_from_cache
submodule-config: add repository argument to submodule_from_{name, path}
submodule-config: allow submodule_free to handle arbitrary repositories
grep: remove "repo" arg from non-supporting funcs
submodule.h: drop declaration of connect_work_tree_and_git_dir
This commit is contained in:
@ -455,7 +455,7 @@ static void init_submodule(const char *path, const char *prefix,
|
||||
|
||||
displaypath = get_submodule_displaypath(path, prefix);
|
||||
|
||||
sub = submodule_from_path(&null_oid, path);
|
||||
sub = submodule_from_path(the_repository, &null_oid, path);
|
||||
|
||||
if (!sub)
|
||||
die(_("No url found for submodule path '%s' in .gitmodules"),
|
||||
@ -622,7 +622,7 @@ static void status_submodule(const char *path, const struct object_id *ce_oid,
|
||||
struct rev_info rev;
|
||||
int diff_files_result;
|
||||
|
||||
if (!submodule_from_path(&null_oid, path))
|
||||
if (!submodule_from_path(the_repository, &null_oid, path))
|
||||
die(_("no submodule mapping found in .gitmodules for path '%s'"),
|
||||
path);
|
||||
|
||||
@ -746,7 +746,7 @@ static int module_name(int argc, const char **argv, const char *prefix)
|
||||
if (argc != 2)
|
||||
usage(_("git submodule--helper name <path>"));
|
||||
|
||||
sub = submodule_from_path(&null_oid, argv[1]);
|
||||
sub = submodule_from_path(the_repository, &null_oid, argv[1]);
|
||||
|
||||
if (!sub)
|
||||
die(_("no submodule mapping found in .gitmodules for path '%s'"),
|
||||
@ -777,7 +777,7 @@ static void sync_submodule(const char *path, const char *prefix,
|
||||
if (!is_submodule_active(the_repository, path))
|
||||
return;
|
||||
|
||||
sub = submodule_from_path(&null_oid, path);
|
||||
sub = submodule_from_path(the_repository, &null_oid, path);
|
||||
|
||||
if (sub && sub->url) {
|
||||
if (starts_with_dot_dot_slash(sub->url) ||
|
||||
@ -930,7 +930,7 @@ static void deinit_submodule(const char *path, const char *prefix,
|
||||
struct strbuf sb_config = STRBUF_INIT;
|
||||
char *sub_git_dir = xstrfmt("%s/.git", path);
|
||||
|
||||
sub = submodule_from_path(&null_oid, path);
|
||||
sub = submodule_from_path(the_repository, &null_oid, path);
|
||||
|
||||
if (!sub || !sub->name)
|
||||
goto cleanup;
|
||||
@ -1264,8 +1264,7 @@ static int module_clone(int argc, const char **argv, const char *prefix)
|
||||
strbuf_reset(&sb);
|
||||
}
|
||||
|
||||
/* Connect module worktree and git dir */
|
||||
connect_work_tree_and_git_dir(path, sm_gitdir);
|
||||
connect_work_tree_and_git_dir(path, sm_gitdir, 0);
|
||||
|
||||
p = git_pathdup_submodule(path, "config");
|
||||
if (!p)
|
||||
@ -1372,7 +1371,7 @@ static int prepare_to_clone_next_submodule(const struct cache_entry *ce,
|
||||
goto cleanup;
|
||||
}
|
||||
|
||||
sub = submodule_from_path(&null_oid, ce->name);
|
||||
sub = submodule_from_path(the_repository, &null_oid, ce->name);
|
||||
|
||||
if (suc->recursive_prefix)
|
||||
displaypath = relative_path(suc->recursive_prefix,
|
||||
@ -1655,7 +1654,7 @@ static const char *remote_submodule_branch(const char *path)
|
||||
const char *branch = NULL;
|
||||
char *key;
|
||||
|
||||
sub = submodule_from_path(&null_oid, path);
|
||||
sub = submodule_from_path(the_repository, &null_oid, path);
|
||||
if (!sub)
|
||||
return NULL;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user