mirror of
https://github.com/git/git.git
synced 2024-09-21 02:54:19 +02:00
builtin/submodule--helper: factor out method to update a single submodule
In a later patch we'll find this method handy. Signed-off-by: Stefan Beller <sbeller@google.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
This commit is contained in:
parent
f1d15713fa
commit
c94d9dc286
@ -1727,10 +1727,17 @@ static int git_update_clone_config(const char *var, const char *value,
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static void update_submodule(struct update_clone_data *ucd)
|
||||||
|
{
|
||||||
|
fprintf(stdout, "dummy %s %d\t%s\n",
|
||||||
|
oid_to_hex(&ucd->oid),
|
||||||
|
ucd->just_cloned,
|
||||||
|
ucd->sub->path);
|
||||||
|
}
|
||||||
|
|
||||||
static int update_submodules(struct submodule_update_clone *suc)
|
static int update_submodules(struct submodule_update_clone *suc)
|
||||||
{
|
{
|
||||||
int i;
|
int i;
|
||||||
struct strbuf sb = STRBUF_INIT;
|
|
||||||
|
|
||||||
run_processes_parallel(suc->max_jobs,
|
run_processes_parallel(suc->max_jobs,
|
||||||
update_clone_get_next_task,
|
update_clone_get_next_task,
|
||||||
@ -1749,16 +1756,9 @@ static int update_submodules(struct submodule_update_clone *suc)
|
|||||||
if (suc->quickstop)
|
if (suc->quickstop)
|
||||||
return 1;
|
return 1;
|
||||||
|
|
||||||
for (i = 0; i < suc->update_clone_nr; i++) {
|
for (i = 0; i < suc->update_clone_nr; i++)
|
||||||
strbuf_addf(&sb, "dummy %s %d\t%s\n",
|
update_submodule(&suc->update_clone[i]);
|
||||||
oid_to_hex(&suc->update_clone[i].oid),
|
|
||||||
suc->update_clone[i].just_cloned,
|
|
||||||
suc->update_clone[i].sub->path);
|
|
||||||
fprintf(stdout, "%s", sb.buf);
|
|
||||||
strbuf_reset(&sb);
|
|
||||||
}
|
|
||||||
|
|
||||||
strbuf_release(&sb);
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user