Skip to content

Commit

Permalink
Merge branch 'jc/mailsplit-warn-on-tty' into jch
Browse files Browse the repository at this point in the history
"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
  • Loading branch information
gitster committed Apr 1, 2022
2 parents a65fcdc + 7b20af6 commit 0fc5801
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions builtin/mailsplit.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit 0fc5801

Please sign in to comment.