2129
return run_command(&cp);
2130
}
2131
2132
-static int run_update_command(const struct update_data *ud, int subforce,
2133
- int *must_die_on_failure)
2132
+static int run_update_command(const struct update_data *ud, int subforce)
2133
{
2134
struct child_process cp = CHILD_PROCESS_INIT;
2135
char *oid = oid_to_hex(&ud->oid);
2192
ud->update_strategy.type);
2193
}
2194
2196
- if (ret == 128)
2197
- *must_die_on_failure = 1;
2195
return ret;
2196
}
2197
2223
return 0;
2224
}
2225
2229
-static int run_update_procedure(const struct update_data *ud,
2230
- int *must_die_on_failure)
2226
+static int run_update_procedure(const struct update_data *ud)
2227
{
2228
int subforce = is_null_oid(&ud->suboid) || ud->force;
2229
2250
ud->displaypath, oid_to_hex(&ud->oid));
2251
}
2252
2257
- return run_update_command(ud, subforce, must_die_on_failure);
2253
+ return run_update_command(ud, subforce);
2254
}
2255
2256
static const char *remote_submodule_branch(const char *path)
2387
"--no-single-branch");
2388
}
2389
2394
-static int update_submodule(struct update_data *update_data,
2395
- int *must_die_on_failure)
2390
+static int update_submodule(struct update_data *update_data)
2391
{
2392
int ret;
2393
2401
update_data->sm_path,
2402
update_data->update_default,
2403
&update_data->update_strategy);
2409
- if (ret) {
2410
- *must_die_on_failure = 1;
2404
+ if (ret)
2405
return ret;
2412
- }
2406
2407
if (update_data->just_cloned)
2408
oidcpy(&update_data->suboid, null_oid());
2430
}
2431
2432
if (!oideq(&update_data->oid, &update_data->suboid) || update_data->force) {
2440
- ret = run_update_procedure(update_data, must_die_on_failure);
2441
- if (*must_die_on_failure)
2442
- return ret;
2433
+ ret = run_update_procedure(update_data);
2434
if (ret)
2444
- return 1;
2435
+ return ret;
2436
}
2437
2438
if (update_data->recursive) {
2449
update_data_to_args(&next, &cp.args);
2450
2451
ret = run_command(&cp);
2461
- if (!ret)
2462
- return 0;
2463
- die_message(_("Failed to recurse into submodule path '%s'"),
2464
- update_data->displaypath);
2465
- if (ret == 128)
2466
- *must_die_on_failure = 1;
2452
+ if (ret)
2453
+ die_message(_("Failed to recurse into submodule path '%s'"),
2454
+ update_data->displaypath);
2455
return ret;
2456
}
2457
2484
2485
for (i = 0; i < suc.update_clone_nr; i++) {
2486
struct update_clone_data ucd = suc.update_clone[i];
2499
- int must_die_on_failure = 0;
2487
int code;
2488
2489
oidcpy(&update_data->oid, &ucd.oid);
2490
update_data->just_cloned = ucd.just_cloned;
2491
update_data->sm_path = ucd.sub->path;
2492
2506
- code = update_submodule(update_data, &must_die_on_failure);
2507
- if (code)
2508
- ret = code;
2509
- if (must_die_on_failure)
2493
+ code = update_submodule(update_data);
2494
+ if (!code)
2495
+ continue;
2496
+ ret = code;
2497
+ if (ret == 128)
2498
goto cleanup;
2511
- else if (code)
2512
- ret = 1;
2499
+ ret = 1;
2500
}
2501
2502
cleanup: