ref-filter: add support for %(upstream:track,nobracket)
[gitweb.git] / connected.c
index 2a51eac759c797019afb4b4244753583693545f2..136c2ac16839b8d4de9b653337dc4794c2a4ea34 100644 (file)
@@ -31,8 +31,11 @@ int check_connected(sha1_iterate_fn fn, void *cb_data,
                opt = &defaults;
        transport = opt->transport;
 
-       if (fn(cb_data, sha1))
+       if (fn(cb_data, sha1)) {
+               if (opt->err_fd)
+                       close(opt->err_fd);
                return err;
+       }
 
        if (transport && transport->smart_options &&
            transport->smart_options->self_contained_and_connected &&
@@ -55,11 +58,19 @@ int check_connected(sha1_iterate_fn fn, void *cb_data,
        argv_array_push(&rev_list.args, "--not");
        argv_array_push(&rev_list.args, "--all");
        argv_array_push(&rev_list.args, "--quiet");
+       if (opt->progress)
+               argv_array_pushf(&rev_list.args, "--progress=%s",
+                                _("Checking connectivity"));
 
        rev_list.git_cmd = 1;
+       rev_list.env = opt->env;
        rev_list.in = -1;
        rev_list.no_stdout = 1;
-       rev_list.no_stderr = opt->quiet;
+       if (opt->err_fd)
+               rev_list.err = opt->err_fd;
+       else
+               rev_list.no_stderr = opt->quiet;
+
        if (start_command(&rev_list))
                return error(_("Could not run 'git rev-list'"));