Changes in v6: * fix some windows compat issues * better comment on the string_list_remove function (also marked extern) Brandon Williams (10): t5550: use write_script to generate post-update hook t0061: run_command executes scripts without a #! line run-command: prepare command before forking run-command: use the async-signal-safe execv instead of execvp string-list: add string_list_remove function run-command: prepare child environment before forking run-command: don't die in child when duping /dev/null run-command: eliminate calls to error handling functions in child run-command: handle dup2 and close errors in child run-command: add note about forking and threading Eric Wong (1): run-command: block signals between fork and execve run-command.c | 404 +++++++++++++++++++++++++++++++++++---------- string-list.c | 18 ++ string-list.h | 7 + t/t0061-run-command.sh | 11 ++ t/t5550-http-fetch-dumb.sh | 5 +- 5 files changed, 360 insertions(+), 85 deletions(-) --- interdiff with 'origin/bw/forking-and-threading' diff --git a/run-command.c b/run-command.c index 1f3c38e43..a97d7bf9f 100644 --- a/run-command.c +++ b/run-command.c @@ -402,7 +402,6 @@ static char **prep_childenv(const char *const *deltaenv) strbuf_release(&key); return childenv; } -#endif struct atfork_state { #ifndef NO_PTHREADS @@ -450,6 +449,7 @@ static void atfork_parent(struct atfork_state *as) "restoring signal mask"); #endif } +#endif /* GIT_WINDOWS_NATIVE */ static inline void set_cloexec(int fd) { diff --git a/string-list.h b/string-list.h index 18520dbc8..29bfb7ae4 100644 --- a/string-list.h +++ b/string-list.h @@ -64,8 +64,10 @@ struct string_list_item *string_list_insert(struct string_list *list, const char /* * Removes the given string from the sorted list. + * If the string doesn't exist, the list is not altered. */ -void string_list_remove(struct string_list *list, const char *string, int free_util); +extern void string_list_remove(struct string_list *list, const char *string, + int free_util); /* * Checks if the given string is part of a sorted list. If it is part of the list, diff --git a/t/t0061-run-command.sh b/t/t0061-run-command.sh index 1a7490e29..98c09dd98 100755 --- a/t/t0061-run-command.sh +++ b/t/t0061-run-command.sh @@ -26,7 +26,7 @@ test_expect_success 'run_command can run a command' ' test_cmp empty err ' -test_expect_success 'run_command can run a script without a #! line' ' +test_expect_success !MINGW 'run_command can run a script without a #! line' ' cat >hello <<-\EOF && cat hello-script EOF -- 2.12.2.816.g2cccc81164-goog