path: root/run-command.c
diff options
authorJohannes Schindelin <>2018-05-02 09:38:39 (GMT)
committerJunio C Hamano <>2018-05-06 10:06:13 (GMT)
commit033abf97fcbc247eabf915780181d947cfb66205 (patch)
tree3bc9fcff58ff630c3d94fbd5535f29948b2b0ef0 /run-command.c
parentdde74d732fc3c5fa4bc4238aa935c164ff6c2dd5 (diff)
Replace all die("BUG: ...") calls by BUG() ones
In d8193743e08 (usage.c: add BUG() function, 2017-05-12), a new macro was introduced to use for reporting bugs instead of die(). It was then subsequently used to convert one single caller in 588a538ae55 (setup_git_env: convert die("BUG") to BUG(), 2017-05-12). The cover letter of the patch series containing this patch (cf is not terribly clear why only one call site was converted, or what the plan is for other, similar calls to die() to report bugs. Let's just convert all remaining ones in one fell swoop. This trick was performed by this invocation: sed -i 's/die("BUG: /BUG("/g' $(git grep -l 'die("BUG' \*.c) Signed-off-by: Johannes Schindelin <> Signed-off-by: Junio C Hamano <>
Diffstat (limited to 'run-command.c')
1 files changed, 5 insertions, 5 deletions
diff --git a/run-command.c b/run-command.c
index 0ad6f13..84b883c 100644
--- a/run-command.c
+++ b/run-command.c
@@ -245,7 +245,7 @@ int sane_execvp(const char *file, char * const argv[])
static const char **prepare_shell_cmd(struct argv_array *out, const char **argv)
if (!argv[0])
- die("BUG: shell command is empty");
+ BUG("shell command is empty");
if (strcspn(argv[0], "|&;<>()$`\\\"' \t\n*?[#~=%") != strlen(argv[0])) {
@@ -383,7 +383,7 @@ static void child_err_spew(struct child_process *cmd, struct child_err *cerr)
static void prepare_cmd(struct argv_array *out, const struct child_process *cmd)
if (!cmd->argv[0])
- die("BUG: command is empty");
+ BUG("command is empty");
* Add SHELL_PATH so in the event exec fails with ENOEXEC we can
@@ -964,7 +964,7 @@ int run_command(struct child_process *cmd)
int code;
if (cmd->out < 0 || cmd->err < 0)
- die("BUG: run_command with a pipe can cause deadlock");
+ BUG("run_command with a pipe can cause deadlock");
code = start_command(cmd);
if (code)
@@ -1554,7 +1554,7 @@ static void pp_init(struct parallel_processes *pp,
pp->data = data;
if (!get_next_task)
- die("BUG: you need to specify a get_next_task function");
+ BUG("you need to specify a get_next_task function");
pp->get_next_task = get_next_task;
pp->start_failure = start_failure ? start_failure : default_start_failure;
@@ -1616,7 +1616,7 @@ static int pp_start_one(struct parallel_processes *pp)
if (pp->children[i].state == GIT_CP_FREE)
if (i == pp->max_processes)
- die("BUG: bookkeeping is hard");
+ BUG("bookkeeping is hard");
code = pp->get_next_task(&pp->children[i].process,