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:
Junio C Hamano
2018-05-08 15:59:17 +09:00
15 changed files with 140 additions and 79 deletions

View File

@ -49,9 +49,11 @@ int cmd__submodule_config(int argc, const char **argv)
die_usage(argc, argv, "Commit not found.");
if (lookup_name) {
submodule = submodule_from_name(&commit_oid, path_or_name);
submodule = submodule_from_name(the_repository,
&commit_oid, path_or_name);
} else
submodule = submodule_from_path(&commit_oid, path_or_name);
submodule = submodule_from_path(the_repository,
&commit_oid, path_or_name);
if (!submodule)
die_usage(argc, argv, "Submodule not found.");
@ -65,7 +67,7 @@ int cmd__submodule_config(int argc, const char **argv)
arg += 2;
}
submodule_free();
submodule_free(the_repository);
return 0;
}