Merge branch 'jc/mailsplit-warn-on-tty'

"git am" can read from the standard input when no mailbox is given
on the command line, but the end-user gets no indication when it
happens, making Git appear stuck.

* jc/mailsplit-warn-on-tty:
  am/apply: warn if we end up reading patches from terminal
This commit is contained in:
Junio C Hamano
2022-04-04 10:56:23 -07:00

View File

@@ -223,6 +223,9 @@ static int split_mbox(const char *file, const char *dir, int allow_bare,
FILE *f = !strcmp(file, "-") ? stdin : fopen(file, "r");
int file_done = 0;
if (isatty(fileno(f)))
warning(_("reading patches from stdin/tty..."));
if (!f) {
error_errno("cannot open mbox %s", file);
goto out;