Skip to content

Commit 6cd5757

Browse files
stefanbellergitster
authored andcommitted
update submodules: move up prepare_submodule_repo_env
In a later patch we need to prepare the submodule environment with another git directory, so split up the function. Also move it up in the file such that we do not need to declare the function later before using it. Signed-off-by: Stefan Beller <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent 84f8925 commit 6cd5757

File tree

1 file changed

+17
-12
lines changed

1 file changed

+17
-12
lines changed

submodule.c

Lines changed: 17 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -356,6 +356,23 @@ static void print_submodule_summary(struct rev_info *rev, FILE *f,
356356
strbuf_release(&sb);
357357
}
358358

359+
static void prepare_submodule_repo_env_no_git_dir(struct argv_array *out)
360+
{
361+
const char * const *var;
362+
363+
for (var = local_repo_env; *var; var++) {
364+
if (strcmp(*var, CONFIG_DATA_ENVIRONMENT))
365+
argv_array_push(out, *var);
366+
}
367+
}
368+
369+
void prepare_submodule_repo_env(struct argv_array *out)
370+
{
371+
prepare_submodule_repo_env_no_git_dir(out);
372+
argv_array_pushf(out, "%s=%s", GIT_DIR_ENVIRONMENT,
373+
DEFAULT_GIT_DIR_ENVIRONMENT);
374+
}
375+
359376
/* Helper function to display the submodule header line prior to the full
360377
* summary output. If it can locate the submodule objects directory it will
361378
* attempt to lookup both the left and right commits and put them into the
@@ -1390,18 +1407,6 @@ int parallel_submodules(void)
13901407
return parallel_jobs;
13911408
}
13921409

1393-
void prepare_submodule_repo_env(struct argv_array *out)
1394-
{
1395-
const char * const *var;
1396-
1397-
for (var = local_repo_env; *var; var++) {
1398-
if (strcmp(*var, CONFIG_DATA_ENVIRONMENT))
1399-
argv_array_push(out, *var);
1400-
}
1401-
argv_array_pushf(out, "%s=%s", GIT_DIR_ENVIRONMENT,
1402-
DEFAULT_GIT_DIR_ENVIRONMENT);
1403-
}
1404-
14051410
/*
14061411
* Embeds a single submodules git directory into the superprojects git dir,
14071412
* non recursively.

0 commit comments

Comments
 (0)