diff options
author | Junio C Hamano <gitster@pobox.com> | 2022-04-04 10:56:23 -0700 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2022-04-04 10:56:23 -0700 |
commit | 1b54f5b89ac2efb5256b1870fabef28ea55e2f20 (patch) | |
tree | 660f6421dc8880c17487ce75a1cea48bba1dbb60 | |
parent | fe496dc5b9b527a85d381a3fc8e5f2fda9439842 (diff) | |
parent | 7b20af6a069f1be1ac0354451e0edd9825b22534 (diff) |
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
-rw-r--r-- | builtin/mailsplit.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/builtin/mailsplit.c b/builtin/mailsplit.c index 7baef30569..30952353a3 100644 --- a/builtin/mailsplit.c +++ b/builtin/mailsplit.c @@ -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; |