Skip to content

Commit 2a959ec

Browse files
peffgitster
authored andcommitted
t4153: stop redirecting input from /dev/zero
Commit 852a171 (am: let command-line options override saved options, 2015-08-04) redirected a few "git am" invocations from /dev/zero, even though it did not expect "am" to read the input. This was necessary at the time because those tests used test_terminal, and as described in 18d8c26 (test_terminal: redirect child process' stdin to a pty, 2015-08-04): 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 But we later dropped the use of test_terminal in 53ce2e3 (am: add explicit "--retry" option, 2024-06-06). That commit dropped one of the redirections from /dev/zero but not the other. In theory the remaining one should not cause any problems, but it turns out that at least one platform (NonStop) does not have /dev/zero at all. We never noticed before because it also did not pass the TTY prereq, meaning these tests were not run at all there until 53ce2e3. So let's drop the useless /dev/zero mention. There are others in the test suite, but they are run only for tests marked with EXPENSIVE (so not typically by default). Reported-by: Randall S. Becker <[email protected]> Signed-off-by: Jeff King <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent 62c71ac commit 2a959ec

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

t/t4153-am-resume-override-opts.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,7 @@ test_expect_success '--reject overrides --no-reject' '
9898
test_path_is_dir .git/rebase-apply &&
9999
test_path_is_missing file.rej &&
100100
101-
test_must_fail git am --retry --reject </dev/zero &&
101+
test_must_fail git am --retry --reject &&
102102
test_path_is_dir .git/rebase-apply &&
103103
test_path_is_file file.rej
104104
'

0 commit comments

Comments
 (0)