ls-remote: create '--sort' option
[gitweb.git] / t / helper / test-run-command.c
index 6bb53da3c0faef2989d749d3df5c26ca3cd76b4a..153342e44dd11ae357cc299a9214f4c365614a5e 100644 (file)
@@ -49,11 +49,20 @@ static int task_finished(int result,
        return 1;
 }
 
-int main(int argc, char **argv)
+int cmd_main(int argc, const char **argv)
 {
        struct child_process proc = CHILD_PROCESS_INIT;
        int jobs;
 
+       if (argc < 3)
+               return 1;
+       while (!strcmp(argv[1], "env")) {
+               if (!argv[2])
+                       die("env specifier without a value");
+               argv_array_push(&proc.env_array, argv[2]);
+               argv += 2;
+               argc -= 2;
+       }
        if (argc < 3)
                return 1;
        proc.argv = (const char **)argv + 2;