On Thu, Jun 12, 2014 at 02:39:01PM -0500, Caleb Thompson wrote:

> t/t7507-commit-verbose.sh was using a global test_set_editor call to
> build its environment.
> Improve robustness against global state changes by having only tests
> which intend to use the $EDITOR to check for presence of a diff in the
> editor set up the test-editor to use check-for-diff rather than relying
> upon the editor set once at script start.

This implies to me that EDITOR is unset after leaving these tests. I
don't think that is how it works, though.  The tests themselves run in
the main environment of the test script. A call to test_set_editor from
one of them will still affect the other tests[1].

I think it works anyway because every subsequent test that cares
actually sets the editor itself.

Or did you just mean that the new rule is "every test sets the editor as
they need", which means that we do not have to worry anymore about
polluting the environment for other tests?


[1] It might make sense for test_set_editor, when run from within a
    test, to behave more like test_config, and do:

      test_when_finished '
        sane_unset FAKE_EDITOR &&
        sane_unset EDITOR

    I don't know if there would be fallouts with other test scripts,
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to