Merge branch 'rj/pager-die-upon-exec-failure'

When GIT_PAGER failed to spawn, depending on the code path taken,
we failed immediately (correct) or just spew the payload to the
standard output (incorrect).  The code now always fail immediately
when GIT_PAGER fails.

* rj/pager-die-upon-exec-failure:
  pager: die when paging to non-existing command
This commit is contained in:
Junio C Hamano
2024-07-08 14:53:08 -07:00
2 changed files with 6 additions and 13 deletions

View File

@@ -137,7 +137,7 @@ void setup_pager(void)
pager_process.in = -1;
strvec_push(&pager_process.env, "GIT_PAGER_IN_USE");
if (start_command(&pager_process))
return;
die("unable to execute pager '%s'", pager);
/* original process continues, but writes to the pipe */
dup2(pager_process.in, 1);