Message ID | 20240717070050.GG547635@coredump.intra.peff.net (mailing list archive) |
---|---|
State | Accepted |
Commit | 2a959ec21a7c9d68df8b9ad69431059caf715de1 |
Headers | show |
Series | t4153: stop redirecting input from /dev/zero | expand |
On Wednesday, July 17, 2024 3:01 AM, Jeff King wrote: >On Sun, Jul 14, 2024 at 03:05:58AM -0400, Jeff King wrote: > >> With --retry I think we would not actually read stdin at all, so we >> could just remove the mention of /dev/zero entirely. But if we wanted >> to be sure it did not read and choke on any input provided, I think just: >> >> diff --git a/t/t4153-am-resume-override-opts.sh >> b/t/t4153-am-resume-override-opts.sh >> index a4d0c03ca6..76783bdd67 100755 >> --- a/t/t4153-am-resume-override-opts.sh >> +++ b/t/t4153-am-resume-override-opts.sh >> @@ -45,6 +45,7 @@ test_expect_success '--3way overrides --no-3way' ' >> >> # Applying side1 with am --3way will succeed due to the threeway-merge. >> # Applying side2 will fail as --3way does not apply to it. >> + echo garbage | >> test_must_fail git am --retry --3way && >> test_path_is_dir .git/rebase-apply && >> test side1 = "$(cat file2)" >> @@ -99,7 +100,8 @@ test_expect_success '--reject overrides --no-reject' ' >> test_path_is_dir .git/rebase-apply && >> test_path_is_missing file.rej && >> >> - test_must_fail git am --retry --reject </dev/zero && >> + echo garbage | >> + test_must_fail git am --retry --reject && >> test_path_is_dir .git/rebase-apply && >> test_path_is_file file.rej >> ' > >Looking at the history, the use of /dev/zero was not here to simulate garbage on >stdin. It really was just meant to be a descriptor which never ran out of input, as a >workaround for test_terminal. This is described in the commit mentioned below. > >So I think we should just do this, which can go on top of jk/am-retry. I still do not >think it is super-urgent, but given the simplicity of the fix is probably worth doing >for the upcoming v2.46, which exposes these tests to more platforms. Might not be urgent but without this we cannot pass this test on NonStop and I'm assuming other non-linux systems. Thanks, --Randall
Jeff King <peff@peff.net> writes: > But we later dropped the use of test_terminal in 53ce2e3f0a (am: add > explicit "--retry" option, 2024-06-06). That commit dropped one of the > redirections from /dev/zero but not the other. Ah, it makes sense to drop that other one with this patch, then. Will queue. Thanks.
diff --git a/t/t4153-am-resume-override-opts.sh b/t/t4153-am-resume-override-opts.sh index a4d0c03ca6..dd6ad8f7a8 100755 --- a/t/t4153-am-resume-override-opts.sh +++ b/t/t4153-am-resume-override-opts.sh @@ -99,7 +99,7 @@ test_expect_success '--reject overrides --no-reject' ' test_path_is_dir .git/rebase-apply && test_path_is_missing file.rej && - test_must_fail git am --retry --reject </dev/zero && + test_must_fail git am --retry --reject && test_path_is_dir .git/rebase-apply && test_path_is_file file.rej '