am: read interactive input from stdin
commit97387c8bdd92596d79a84ce8a479c6b3c16d0cb7
authorJeff King <peff@peff.net>
Mon, 20 May 2019 12:09:26 +0000 (20 08:09 -0400)
committerJunio C Hamano <gitster@pobox.com>
Tue, 28 May 2019 17:26:36 +0000 (28 10:26 -0700)
tree7a026f280c94a43ff9a66986ca49841b0c6937cb
parent1db65f324ecf246f7f5f8e0158daab0420dd18bc
am: read interactive input from stdin

In the conversion of git-am from shell script to C, we switched to using
git_prompt(). Unlike the original shell command "read reply", this
doesn't read from stdin at all, but rather from /dev/tty.

In most cases this distinction wouldn't matter. We require (as the shell
script did) that stdin is a tty, so they would generally be the same
thing. But one important exception is our test suite: even with
test_terminal, we cannot test "am --interactive" because it insists on
reading from /dev/tty, not the pseudo-tty we've set up in the test
script.

Fixing this clears the way to adding tests in a future patch.

Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
builtin/am.c