check_connected: accept an env argument

This lets callers influence the environment seen by rev-list, which will be useful when we start providing quarantined objects. Signed-off-by: Jeff King <peff@peff.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>

Jeff King committed Oct 3, 2016 at 16:49 UTC 526f108a271b331af9ae92796215e560e5ec4677
2 files changed +6
connected.c
+1
@@ -63,6 +63,7 @@ int check_connected(sha1_iterate_fn fn, void *cb_data,
63 _("Checking connectivity"));
64
65 rev_list.git_cmd = 1;
66 + rev_list.env = opt->env;
67 rev_list.in = -1;
68 rev_list.no_stdout = 1;
69 if (opt->err_fd)
connected.h
+5
@@ -33,6 +33,11 @@ struct check_connected_options {
33
34 /* If non-zero, show progress as we traverse the objects. */
35 int progress;
36 +
37 + /*
38 + * Insert these variables into the environment of the child process.
39 + */
40 + const char **env;
41 };
42
43 #define CHECK_CONNECTED_INIT { 0 }