292
293
for (d = describe_argv; *d; d++) {
294
struct child_process cp = CHILD_PROCESS_INIT;
295
- prepare_submodule_repo_env(&cp.env_array);
295
+ prepare_submodule_repo_env(&cp.env);
296
cp.dir = sub_path;
297
cp.git_cmd = 1;
298
cp.no_stderr = 1;
479
if (!is_submodule_populated_gently(path, NULL))
480
goto cleanup;
481
482
- prepare_submodule_repo_env(&cp.env_array);
482
+ prepare_submodule_repo_env(&cp.env);
483
484
/*
485
* For the purpose of executing <command> in the submodule,
499
char *toplevel = xgetcwd();
500
struct strbuf sb = STRBUF_INIT;
501
502
- strvec_pushf(&cp.env_array, "name=%s", sub->name);
503
- strvec_pushf(&cp.env_array, "sm_path=%s", path);
504
- strvec_pushf(&cp.env_array, "displaypath=%s", displaypath);
505
- strvec_pushf(&cp.env_array, "sha1=%s",
502
+ strvec_pushf(&cp.env, "name=%s", sub->name);
503
+ strvec_pushf(&cp.env, "sm_path=%s", path);
504
+ strvec_pushf(&cp.env, "displaypath=%s", displaypath);
505
+ strvec_pushf(&cp.env, "sha1=%s",
506
oid_to_hex(ce_oid));
507
- strvec_pushf(&cp.env_array, "toplevel=%s", toplevel);
507
+ strvec_pushf(&cp.env, "toplevel=%s", toplevel);
508
509
/*
510
* Since the path variable was accessible from the script
536
537
cpr.git_cmd = 1;
538
cpr.dir = path;
539
- prepare_submodule_repo_env(&cpr.env_array);
539
+ prepare_submodule_repo_env(&cpr.env);
540
541
strvec_pushl(&cpr.args, "--super-prefix", NULL);
542
strvec_pushf(&cpr.args, "%s/", displaypath);
833
834
cpr.git_cmd = 1;
835
cpr.dir = path;
836
- prepare_submodule_repo_env(&cpr.env_array);
836
+ prepare_submodule_repo_env(&cpr.env);
837
838
strvec_push(&cpr.args, "--super-prefix");
839
strvec_pushf(&cpr.args, "%s/", displaypath);
955
956
cp_rev_parse.git_cmd = 1;
957
cp_rev_parse.dir = sm_path;
958
- prepare_submodule_repo_env(&cp_rev_parse.env_array);
958
+ prepare_submodule_repo_env(&cp_rev_parse.env);
959
strvec_pushl(&cp_rev_parse.args, "rev-parse", "-q", "--short", NULL);
960
strvec_pushf(&cp_rev_parse.args, "%s^0", committish);
961
strvec_push(&cp_rev_parse.args, "--");
996
997
cp_log.git_cmd = 1;
998
cp_log.dir = p->sm_path;
999
- prepare_submodule_repo_env(&cp_log.env_array);
999
+ prepare_submodule_repo_env(&cp_log.env);
1000
strvec_pushl(&cp_log.args, "log", NULL);
1001
1002
if (S_ISGITLINK(p->mod_src) && S_ISGITLINK(p->mod_dst)) {
1113
1114
cp_rev_list.git_cmd = 1;
1115
cp_rev_list.dir = p->sm_path;
1116
- prepare_submodule_repo_env(&cp_rev_list.env_array);
1116
+ prepare_submodule_repo_env(&cp_rev_list.env);
1117
1118
if (!capture_command(&cp_rev_list, &sb_rev_list, 0))
1119
total_commits = atoi(sb_rev_list.buf);
1414
1415
cpr.git_cmd = 1;
1416
cpr.dir = path;
1417
- prepare_submodule_repo_env(&cpr.env_array);
1417
+ prepare_submodule_repo_env(&cpr.env);
1418
1419
strvec_push(&cpr.args, "--super-prefix");
1420
strvec_pushf(&cpr.args, "%s/", displaypath);
1819
strvec_push(&cp.args, clone_data->path);
1820
1821
cp.git_cmd = 1;
1822
- prepare_submodule_repo_env(&cp.env_array);
1822
+ prepare_submodule_repo_env(&cp.env);
1823
cp.no_stdin = 1;
1824
1825
if(run_command(&cp))
2295
cp.no_stderr = 1;
2296
strvec_pushl(&cp.args, "rev-list", "-n", "1", hex, "--not", "--all", NULL);
2297
2298
- prepare_submodule_repo_env(&cp.env_array);
2298
+ prepare_submodule_repo_env(&cp.env);
2299
2300
if (capture_command(&cp, &rev, GIT_MAX_HEXSZ + 1) || rev.len)
2301
return 0;
2307
{
2308
struct child_process cp = CHILD_PROCESS_INIT;
2309
2310
- prepare_submodule_repo_env(&cp.env_array);
2310
+ prepare_submodule_repo_env(&cp.env);
2311
cp.git_cmd = 1;
2312
cp.dir = xstrdup(module_path);
2313
2364
strvec_push(&cp.args, oid);
2365
2366
cp.dir = xstrdup(ud->sm_path);
2367
- prepare_submodule_repo_env(&cp.env_array);
2367
+ prepare_submodule_repo_env(&cp.env);
2368
if (run_command(&cp)) {
2369
switch (ud->update_strategy.type) {
2370
case SM_UPDATE_CHECKOUT:
2630
2631
cp.dir = update_data->sm_path;
2632
cp.git_cmd = 1;
2633
- prepare_submodule_repo_env(&cp.env_array);
2633
+ prepare_submodule_repo_env(&cp.env);
2634
update_data_to_args(&next, &cp.args);
2635
2636
/* die() if child process die()'d */
3123
struct strbuf sb_remote_out = STRBUF_INIT;
3124
3125
cp_remote.git_cmd = 1;
3126
- strvec_pushf(&cp_remote.env_array,
3126
+ strvec_pushf(&cp_remote.env,
3127
"GIT_DIR=%s", git_dir_path);
3128
- strvec_push(&cp_remote.env_array, "GIT_WORK_TREE=.");
3128
+ strvec_push(&cp_remote.env, "GIT_WORK_TREE=.");
3129
strvec_pushl(&cp_remote.args, "remote", "-v", NULL);
3130
if (!capture_command(&cp_remote, &sb_remote_out, 0)) {
3131
char *next_line;
3209
if (clone_submodule(&clone_data))
3210
return -1;
3211
3212
- prepare_submodule_repo_env(&cp.env_array);
3212
+ prepare_submodule_repo_env(&cp.env);
3213
cp.git_cmd = 1;
3214
cp.dir = add_data->sm_path;
3215
/*