Skip to content

Commit 1b54f5b

Browse files
committed
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
2 parents fe496dc + 7b20af6 commit 1b54f5b

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

builtin/mailsplit.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -223,6 +223,9 @@ static int split_mbox(const char *file, const char *dir, int allow_bare,
223223
FILE *f = !strcmp(file, "-") ? stdin : fopen(file, "r");
224224
int file_done = 0;
225225

226+
if (isatty(fileno(f)))
227+
warning(_("reading patches from stdin/tty..."));
228+
226229
if (!f) {
227230
error_errno("cannot open mbox %s", file);
228231
goto out;

0 commit comments

Comments
 (0)