summaryrefslogtreecommitdiff
path: root/run-command.c
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2016-04-06 18:39:01 (GMT)
committerJunio C Hamano <gitster@pobox.com>2016-04-06 18:39:01 (GMT)
commitbdebbeb3346e9867005947aff356b99a7358e5ab (patch)
tree36d4dc9b1776fef1794432de7dd0c3a50793a9e1 /run-command.c
parent77e075124acc3f1185a8b178aac479c8278780a5 (diff)
parent72290d6a1d8cccd22f58c21418c0f75bfcdf574d (diff)
downloadgit-bdebbeb3346e9867005947aff356b99a7358e5ab.zip
git-bdebbeb3346e9867005947aff356b99a7358e5ab.tar.gz
git-bdebbeb3346e9867005947aff356b99a7358e5ab.tar.bz2
Merge branch 'sb/submodule-parallel-update'
A major part of "git submodule update" has been ported to C to take advantage of the recently added framework to run download tasks in parallel. * sb/submodule-parallel-update: clone: allow an explicit argument for parallel submodule clones submodule update: expose parallelism to the user submodule helper: remove double 'fatal: ' prefix git submodule update: have a dedicated helper for cloning run_processes_parallel: rename parameters for the callbacks run_processes_parallel: treat output of children as byte array submodule update: direct error message to stderr fetching submodules: respect `submodule.fetchJobs` config option submodule-config: drop check against NULL submodule-config: keep update strategy around
Diffstat (limited to 'run-command.c')
-rw-r--r--run-command.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/run-command.c b/run-command.c
index c726010..8c7115a 100644
--- a/run-command.c
+++ b/run-command.c
@@ -902,7 +902,7 @@ struct parallel_processes {
struct strbuf buffered_output; /* of finished children */
};
-static int default_start_failure(struct strbuf *err,
+static int default_start_failure(struct strbuf *out,
void *pp_cb,
void *pp_task_cb)
{
@@ -910,7 +910,7 @@ static int default_start_failure(struct strbuf *err,
}
static int default_task_finished(int result,
- struct strbuf *err,
+ struct strbuf *out,
void *pp_cb,
void *pp_task_cb)
{
@@ -994,7 +994,7 @@ static void pp_cleanup(struct parallel_processes *pp)
* When get_next_task added messages to the buffer in its last
* iteration, the buffered output is non empty.
*/
- fputs(pp->buffered_output.buf, stderr);
+ strbuf_write(&pp->buffered_output, stderr);
strbuf_release(&pp->buffered_output);
sigchain_pop_common();
@@ -1079,7 +1079,7 @@ static void pp_output(struct parallel_processes *pp)
int i = pp->output_owner;
if (pp->children[i].state == GIT_CP_WORKING &&
pp->children[i].err.len) {
- fputs(pp->children[i].err.buf, stderr);
+ strbuf_write(&pp->children[i].err, stderr);
strbuf_reset(&pp->children[i].err);
}
}
@@ -1117,11 +1117,11 @@ static int pp_collect_finished(struct parallel_processes *pp)
strbuf_addbuf(&pp->buffered_output, &pp->children[i].err);
strbuf_reset(&pp->children[i].err);
} else {
- fputs(pp->children[i].err.buf, stderr);
+ strbuf_write(&pp->children[i].err, stderr);
strbuf_reset(&pp->children[i].err);
/* Output all other finished child processes */
- fputs(pp->buffered_output.buf, stderr);
+ strbuf_write(&pp->buffered_output, stderr);
strbuf_reset(&pp->buffered_output);
/*