Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.kernel.org/pub/scm/git/git.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2022-03-04 00:58:39 +0300
committerJunio C Hamano <gitster@pobox.com>2022-03-04 01:00:32 +0300
commit7b20af6a069f1be1ac0354451e0edd9825b22534 (patch)
treeab3f2f59a3401bff57c3e536fb6a4c3943326463 /builtin/mailsplit.c
parent4c53a8c20f8984adb226293a3ffd7b88c3f4ac1a (diff)
am/apply: warn if we end up reading patches from terminal
In an interactive session, "git am" without arguments, or even worse, "git am --whitespace file", waits silently for the user to feed the patches from the standard input (presumably by typing or copy-pasting). Give a feedback message to the user when this happens, as it is unlikely that the user meant to do so. Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'builtin/mailsplit.c')
-rw-r--r--builtin/mailsplit.c3
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;