submodule: convert get_next_submodule to not rely on the_index

Instead of implicitly relying on the global 'the_index', convert
'get_next_submodule()' to use the index of the repository stored in the
callback data 'struct submodule_parallel_fetch'.

Since this removes the last user of the index compatibility macros,
define 'NO_THE_INDEX_COMPATIBILITY_MACROS' to prevent future users of
these macros in submodule.c.

Signed-off-by: Brandon Williams <bmwill@google.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
This commit is contained in:
Brandon Williams
2017-12-12 11:53:52 -08:00
committed by Junio C Hamano
parent 7da9aba417
commit e724197f23
3 changed files with 22 additions and 15 deletions

View File

@ -3,6 +3,7 @@
*/
#include "cache.h"
#include "config.h"
#include "repository.h"
#include "refs.h"
#include "commit.h"
#include "builtin.h"
@ -1397,7 +1398,8 @@ int cmd_fetch(int argc, const char **argv, const char *prefix)
struct argv_array options = ARGV_ARRAY_INIT;
add_options_to_argv(&options);
result = fetch_populated_submodules(&options,
result = fetch_populated_submodules(the_repository,
&options,
submodule_prefix,
recurse_submodules,
recurse_submodules_default,