Merge branch 'jk/execv-dashed-external'
authorJunio C Hamano <gitster@pobox.com>
Fri, 24 Mar 2017 20:07:34 +0000 (13:07 -0700)
committerJunio C Hamano <gitster@pobox.com>
Fri, 24 Mar 2017 20:07:34 +0000 (13:07 -0700)
Fix for NO_PTHREADS build.

* jk/execv-dashed-external:
run-command: fix segfault when cleaning forked async process

1  2 
run-command.c
diff --combined run-command.c
index 5227f78aeaae7e76bfc85d4d7ca2886b2b52215e,7dc8a8e70e172d8a9df293cc40b6071693d49430..574b81d3e82bbe6de31b141c3951ab408daad5e6
@@@ -48,7 -48,7 +48,7 @@@ static void cleanup_children(int sig, i
  
                kill(p->pid, sig);
  
-               if (p->process->wait_after_clean) {
+               if (p->process && p->process->wait_after_clean) {
                        p->next = children_to_wait_for;
                        children_to_wait_for = p;
                } else {
@@@ -871,14 -871,8 +871,14 @@@ const char *find_hook(const char *name
  
        strbuf_reset(&path);
        strbuf_git_path(&path, "hooks/%s", name);
 -      if (access(path.buf, X_OK) < 0)
 +      if (access(path.buf, X_OK) < 0) {
 +#ifdef STRIP_EXTENSION
 +              strbuf_addstr(&path, STRIP_EXTENSION);
 +              if (access(path.buf, X_OK) >= 0)
 +                      return path.buf;
 +#endif
                return NULL;
 +      }
        return path.buf;
  }