aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2009-01-26 21:13:00 -0800
committerJunio C Hamano <gitster@pobox.com>2009-01-26 21:33:51 -0800
commit2d6061537f3f27112f80a6e1047b5c566084ef7d (patch)
tree4b8ea5541a793067a8de49721c53a155feed726a
parenta6c7a27691bd8b059d39c9bc71b19fb8e614fa54 (diff)
downloadgit-2d6061537f3f27112f80a6e1047b5c566084ef7d.tar.gz
git-2d6061537f3f27112f80a6e1047b5c566084ef7d.tar.xz
tests: Avoid single-shot environment export for shell function invocation
Some shells have issues with a single-shot environment variable export when invoking a shell function. This fixes the ones I found that invoke test_must_fail that way. Signed-off-by: Junio C Hamano <gitster@pobox.com>
-rwxr-xr-xt/t3409-rebase-hook.sh6
-rwxr-xr-xt/t3412-rebase-root.sh24
2 files changed, 25 insertions, 5 deletions
diff --git a/t/t3409-rebase-hook.sh b/t/t3409-rebase-hook.sh
index 1f1b85067..098b75507 100755
--- a/t/t3409-rebase-hook.sh
+++ b/t/t3409-rebase-hook.sh
@@ -118,7 +118,11 @@ test_expect_success 'pre-rebase hook stops rebase (1)' '
test_expect_success 'pre-rebase hook stops rebase (2)' '
git checkout test &&
git reset --hard side &&
- EDITOR=true test_must_fail git rebase -i master &&
+ (
+ EDITOR=:
+ export EDITOR
+ test_must_fail git rebase -i master
+ ) &&
test "z$(git symbolic-ref HEAD)" = zrefs/heads/test &&
test 0 = $(git rev-list HEAD...side | wc -l)
'
diff --git a/t/t3412-rebase-root.sh b/t/t3412-rebase-root.sh
index ef6f7a54a..3d8ff674c 100755
--- a/t/t3412-rebase-root.sh
+++ b/t/t3412-rebase-root.sh
@@ -172,14 +172,22 @@ EOF
test_expect_success 'pre-rebase hook stops rebase' '
git checkout -b stops1 other &&
- GIT_EDITOR=: test_must_fail git rebase --root --onto master &&
+ (
+ GIT_EDITOR=:
+ export GIT_EDITOR
+ test_must_fail git rebase --root --onto master
+ ) &&
test "z$(git symbolic-ref HEAD)" = zrefs/heads/stops1
test 0 = $(git rev-list other...stops1 | wc -l)
'
test_expect_success 'pre-rebase hook stops rebase -i' '
git checkout -b stops2 other &&
- GIT_EDITOR=: test_must_fail git rebase --root --onto master &&
+ (
+ GIT_EDITOR=:
+ export GIT_EDITOR
+ test_must_fail git rebase --root --onto master
+ ) &&
test "z$(git symbolic-ref HEAD)" = zrefs/heads/stops2
test 0 = $(git rev-list other...stops2 | wc -l)
'
@@ -224,7 +232,11 @@ test_expect_success 'rebase --root with conflict (second part)' '
test_expect_success 'rebase -i --root with conflict (first part)' '
git checkout -b conflict2 other &&
- GIT_EDITOR=: test_must_fail git rebase -i --root --onto master &&
+ (
+ GIT_EDITOR=:
+ export GIT_EDITOR
+ test_must_fail git rebase -i --root --onto master
+ ) &&
git ls-files -u | grep "B$"
'
@@ -262,7 +274,11 @@ EOF
test_expect_success 'rebase -i -p --root with conflict (first part)' '
git checkout -b conflict3 other &&
- GIT_EDITOR=: test_must_fail git rebase -i -p --root --onto master &&
+ (
+ GIT_EDITOR=:
+ export GIT_EDITOR
+ test_must_fail git rebase -i -p --root --onto master
+ ) &&
git ls-files -u | grep "B$"
'