Re: [PATCH 1/5] t3416: set $EDITOR in subshell
- From
Junio C Hamano <gitster@pobox.com>
- Date
- Aug 15, 2022, 16:53 UTC
- Message-ID
- <xmqqo7wl30tt.fsf@gitster.g>
- In-Reply-To
- <c1d91a2b190c6ea4550e33260a48a51cd0653a21.1660576283.git.gitgitgadget@gmail.com>
"Phillip Wood via GitGitGadget" <gitgitgadget@gmail.com> writes:
Show 5 quoted lines
> From: Phillip Wood <phillip.wood@dunelm.org.uk> > > As $EDITOR is exported setting it in one test affects all subsequent > tests. Avoid this by always setting it in a subshell and remove a > couple of unnecessary call to set_fake_editor.
Unnecessary because it reuses the one that was established in the previous test [1]? Or unnecessary because we know "rebase -i" would fail even before it gets to the point of asking an editor to tweak the todo sequence [2]? Or something else?
If [1], it makes us wonder what happens when an earlier test gets skipped. If [2], it makes us wonder what happens when "rebase -i" fails to fail as expected (does the test correctly diagnose it as a new breakage in "rebase -i"?).
Show 7 quoted lines
> @@ -102,7 +106,6 @@ test_expect_success 'rebase -i --onto main...side' ' > git checkout side && > git reset --hard K && > > - set_fake_editor && > test_must_fail git rebase -i --onto main...side J > '
This is one of the "removing" instances.
Show 7 quoted lines
> @@ -187,8 +194,12 @@ test_expect_success 'rebase -i --keep-base main from side' ' > git checkout side && > git reset --hard K && > > - set_fake_editor && > test_must_fail git rebase -i --keep-base main > '
And this is the other one.
Thanks.