t1510 (worktree): fix '&&' chaining

Breaks in a test assertion's && chain can potentially hide failures from earlier commands in the chain. 'unset' returns non-zero status when the variable passed was already unset on some shells; we need to change these instances to 'sane_unset'. Helped-by: Jonathan Nieder <jrnieder@gmail.com> Signed-off-by: Ramkumar Ramachandra <artagnon@gmail.com> Acked-by: Jonathan Nieder <jrnieder@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>

Ramkumar Ramachandra committed Dec 8, 2011 at 18:40 UTC 7f9a5fc6876a3158cb29b0c2d13ccb226ec7d679
1 file changed +3 -3
t/t1501-worktree.sh
+3 -3
@@ -48,7 +48,7 @@ test_expect_success 'setup: helper for testing rev-parse' '
48 '
49
50 test_expect_success 'setup: core.worktree = relative path' '
51 - unset GIT_WORK_TREE;
51 + sane_unset GIT_WORK_TREE &&
52 GIT_DIR=repo.git &&
53 GIT_CONFIG="$(pwd)"/$GIT_DIR/config &&
54 export GIT_DIR GIT_CONFIG &&
@@ -89,7 +89,7 @@ test_expect_success 'subdir of work tree' '
89 '
90
91 test_expect_success 'setup: core.worktree = absolute path' '
92 - unset GIT_WORK_TREE;
92 + sane_unset GIT_WORK_TREE &&
93 GIT_DIR=$(pwd)/repo.git &&
94 GIT_CONFIG=$GIT_DIR/config &&
95 export GIT_DIR GIT_CONFIG &&
@@ -334,7 +334,7 @@ test_expect_success 'absolute pathspec should fail gracefully' '
334 '
335
336 test_expect_success 'make_relative_path handles double slashes in GIT_DIR' '
337 - >dummy_file
337 + >dummy_file &&
338 echo git --git-dir="$(pwd)//repo.git" --work-tree="$(pwd)" add dummy_file &&
339 git --git-dir="$(pwd)//repo.git" --work-tree="$(pwd)" add dummy_file
340 '