summaryrefslogtreecommitdiff
path: root/transport.c
diff options
context:
space:
mode:
authorPaul Tan <pyokagan@gmail.com>2015-08-04 14:08:49 (GMT)
committerJunio C Hamano <gitster@pobox.com>2015-08-12 17:33:46 (GMT)
commit18d8c26930acbba1627d2a8b7323be30ac2bd9bb (patch)
tree34999601b1c55a10394a901b70827e2c754e0c34 /transport.c
parente97a5e765db06995c3b027a5d7dceb6b4f2cba02 (diff)
downloadgit-18d8c26930acbba1627d2a8b7323be30ac2bd9bb.zip
git-18d8c26930acbba1627d2a8b7323be30ac2bd9bb.tar.gz
git-18d8c26930acbba1627d2a8b7323be30ac2bd9bb.tar.bz2
test_terminal: redirect child process' stdin to a pty
When resuming, git-am detects if we are trying to feed it patches or not by checking if stdin is a TTY. However, the test library redirects stdin to /dev/null. This makes it difficult, for instance, to test the behavior of "git am -3" when resuming, as git-am will think we are trying to feed it patches and error out. Support this use case by extending test-terminal.perl to create a pseudo-tty for the child process' standard input as well. Note that due to the way the code is structured, the child's stdin pseudo-tty will be closed when we finish reading from our stdin. This means that in the common case, where our stdin is attached to /dev/null, the child's stdin pseudo-tty will be closed immediately. Some operations like isatty(), which git-am uses, require the file descriptor to be open, and hence if the success of the command depends on such functions, test_terminal's stdin should be redirected to a source with large amount of data to ensure that the child's stdin is not closed, e.g. test_terminal git am --3way </dev/zero Cc: Jonathan Nieder <jrnieder@gmail.com> Cc: Jeff King <peff@peff.net> Signed-off-by: Paul Tan <pyokagan@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'transport.c')
0 files changed, 0 insertions, 0 deletions