Re: [PATCH v2 2/7] t3416: set $EDITOR in subshell
- From
Junio C Hamano <gitster@pobox.com>
- Date
- Sep 7, 2022, 18:12 UTC
- Message-ID
- <xmqq5yhzvytn.fsf@gitster.g>
- In-Reply-To
- <d6f2f716c77cbd0a19b3b6032f69f6dd9b257e96.1662561470.git.gitgitgadget@gmail.com>
"Phillip Wood via GitGitGadget" <gitgitgadget@gmail.com> writes:
Show 6 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. Also remove a > couple of unnecessary call to set_fake_editor where the editor does > not change the todo list.
True.
The fact that we need to do this makes me wonder if we want a restore_editor (or a hardcoded "export EDITOR=:") that allows us not to go to a subshell, as going to a subshell has its downsides (e.g. we cannot use helpers that rely on being able to modify globals, like test_commit and test_when_finished), but for now this looks OK.
Thanks.