Skip to content

Commit

Permalink
t3404: make test 57 work with dash and others
Browse files Browse the repository at this point in the history
The construct

	VAR=value test_must_fail command args

works only for some shells (such as bash) but not others (such as dash)
because VAR=value does not end up in the environment for command when it
is called by the shell function test_must_fail. That is why we explicitly
set and export variable in a subshell, i.e.

	(
		VAR=value &&
		export VAR &&
		test_must_fail command args
	)

in most places already, bar the newly introduced 57 from b64b7fe
(Add tests for rebase -i --root without --onto, 2012-06-26).

Make test 57 use that construct also.

Signed-off-by: Michael J Gruber <git@drmicha.warpmail.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
  • Loading branch information
Michael J Gruber authored and Junio C Hamano committed Jul 5, 2012
1 parent b64b7fe commit 994fd91
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion t/t3404-rebase-interactive.sh
Original file line number Diff line number Diff line change
Expand Up @@ -777,7 +777,11 @@ test_expect_success 'rebase -i --root retain root commit author and message' '

test_expect_success 'rebase -i --root temporary sentinel commit' '
git checkout B &&
FAKE_LINES="2" test_must_fail git rebase -i --root &&
(
FAKE_LINES="2" &&
export FAKE_LINES &&
test_must_fail git rebase -i --root
) &&
git cat-file commit HEAD | grep "^tree 4b825dc642cb" &&
git rebase --abort
'
Expand Down

0 comments on commit 994fd91

Please sign in to comment.