summaryrefslogtreecommitdiff
path: root/t/t3301-notes.sh
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2014-03-31 16:30:40 -0700
committerJunio C Hamano <gitster@pobox.com>2014-03-31 16:30:40 -0700
commitfa73d354689aa577d564b03d22f87c34b6288a78 (patch)
treed9b0fafb6bd690397265aae2d549489546dfe004 /t/t3301-notes.sh
parent96e67c86f817b4fbd492b12f57dae4bd821571ba (diff)
parent512477b175288a429aaf4071dc9fe94f17f0e4ee (diff)
downloadgit-fa73d354689aa577d564b03d22f87c34b6288a78.tar.gz
Merge branch 'dt/tests-with-env-not-subshell'
* dt/tests-with-env-not-subshell: tests: use "env" to run commands with temporary env-var settings
Diffstat (limited to 't/t3301-notes.sh')
-rwxr-xr-xt/t3301-notes.sh22
1 files changed, 6 insertions, 16 deletions
diff --git a/t/t3301-notes.sh b/t/t3301-notes.sh
index 3bb79a47af..cfd67ff3df 100755
--- a/t/t3301-notes.sh
+++ b/t/t3301-notes.sh
@@ -17,7 +17,7 @@ GIT_EDITOR=./fake_editor.sh
export GIT_EDITOR
test_expect_success 'cannot annotate non-existing HEAD' '
- (MSG=3 && export MSG && test_must_fail git notes add)
+ test_must_fail env MSG=3 git notes add
'
test_expect_success setup '
@@ -32,22 +32,16 @@ test_expect_success setup '
'
test_expect_success 'need valid notes ref' '
- (MSG=1 GIT_NOTES_REF=/ && export MSG GIT_NOTES_REF &&
- test_must_fail git notes add) &&
- (MSG=2 GIT_NOTES_REF=/ && export MSG GIT_NOTES_REF &&
- test_must_fail git notes show)
+ test_must_fail env MSG=1 GIT_NOTES_REF=/ git notes show &&
+ test_must_fail env MSG=2 GIT_NOTES_REF=/ git notes show
'
test_expect_success 'refusing to add notes in refs/heads/' '
- (MSG=1 GIT_NOTES_REF=refs/heads/bogus &&
- export MSG GIT_NOTES_REF &&
- test_must_fail git notes add)
+ test_must_fail env MSG=1 GIT_NOTES_REF=refs/heads/bogus git notes add
'
test_expect_success 'refusing to edit notes in refs/remotes/' '
- (MSG=1 GIT_NOTES_REF=refs/remotes/bogus &&
- export MSG GIT_NOTES_REF &&
- test_must_fail git notes edit)
+ test_must_fail env MSG=1 GIT_NOTES_REF=refs/heads/bogus git notes edit
'
# 1 indicates caught gracefully by die, 128 means git-show barked
@@ -865,11 +859,7 @@ test_expect_success 'create note from non-existing note with "git notes add -c"
git add a10 &&
test_tick &&
git commit -m 10th &&
- (
- MSG="yet another note" &&
- export MSG &&
- test_must_fail git notes add -c deadbeef
- ) &&
+ test_must_fail env MSG="yet another note" git notes add -c deadbeef &&
test_must_fail git notes list HEAD
'