Re: [PATCH 1/3] t3404: restore specialized rebase-editor following commentchar test
- From
Junio C Hamano <gitster@pobox.com>
- Date
- Aug 12, 2013, 06:28 UTC
- Message-ID
- <7v4nav1kzx.fsf@alter.siamese.dyndns.org>
- In-Reply-To
- <1376280459-55188-2-git-send-email-sunshine@sunshineco.com>
Eric Sunshine <sunshine@sunshineco.com> writes:
Show 6 quoted lines
> At start of script, t3404 installs a specialized test-editor ($EDITOR) > upon which many of the interactive rebase tests depend. Late in t3404, > test "rebase -i respects core.commentchar" installs its own custom > editor but neglects to restore the specialized editor when finished. > This oversight will cause later tests, which require the specialized > editor, to fail.
That is not oversight but was deliberately done knowing that it will be the last test (and new tests can be added before it).
I think the patch is one way to give _known_ status to later tests by declaring the editor installed by "set_fake_editor" the gold standard, but isn't a better alternative to make sure that any newly added tests after this point (or before the commentchar tests, for that matter) set a fake editor it wants to use explicitly?
Show 20 quoted lines
> (There are no such tests presently, but a subsequent > patch will introduce one.) Fix this problem. > > Signed-off-by: Eric Sunshine <sunshine@sunshineco.com> > --- > t/t3404-rebase-interactive.sh | 1 + > 1 file changed, 1 insertion(+) > > diff --git a/t/t3404-rebase-interactive.sh b/t/t3404-rebase-interactive.sh > index 49ccb38..af141be 100755 > --- a/t/t3404-rebase-interactive.sh > +++ b/t/t3404-rebase-interactive.sh > @@ -949,6 +949,7 @@ test_expect_success 'rebase -i respects core.commentchar' ' > sed -e "2,\$s/^/\\\\/" "$1" >"$1.tmp" && > mv "$1.tmp" "$1" > EOF > + test_when_finished "set_fake_editor" && > test_set_editor "$(pwd)/remove-all-but-first.sh" && > git rebase -i B && > test B = $(git cat-file commit HEAD^ | sed -ne \$p)