Merge branch 'cc/subprocess-handshake-missing-capabilities' into maint
authorJunio C Hamano <gitster@pobox.com>
Wed, 18 Oct 2017 05:19:10 +0000 (14:19 +0900)
committerJunio C Hamano <gitster@pobox.com>
Wed, 18 Oct 2017 05:19:10 +0000 (14:19 +0900)
Finishing touches to a topic already in 'master'.

* cc/subprocess-handshake-missing-capabilities:
subprocess: loudly die when subprocess asks for an unsupported capability

1  2 
sub-process.c
diff --combined sub-process.c
index 648b3a3943d68eb8a6cfc975541df8df152c4a45,ec9a51b7b1c41824fdc38a21ae09f32c41d89b01..80571567f2a64be451fe2ac92c230f66fa04c844
@@@ -74,12 -74,13 +74,12 @@@ int subprocess_start(struct hashmap *ha
  {
        int err;
        struct child_process *process;
 -      const char *argv[] = { cmd, NULL };
  
        entry->cmd = cmd;
        process = &entry->process;
  
        child_process_init(process);
 -      process->argv = argv;
 +      argv_array_push(&process->args, cmd);
        process->use_shell = 1;
        process->in = -1;
        process->out = -1;
@@@ -180,8 -181,8 +180,8 @@@ static int handshake_capabilities(struc
                        if (supported_capabilities)
                                *supported_capabilities |= capabilities[i].flag;
                } else {
-                       warning("subprocess '%s' requested unsupported capability '%s'",
-                               process->argv[0], p);
+                       die("subprocess '%s' requested unsupported capability '%s'",
+                           process->argv[0], p);
                }
        }