Skip to content

Commit 4f4d201

Browse files
avargitster
authored andcommitted
svn tests: refactor away a "set -e" in test body
Refactor a test added in 83c9433 (git-svn: support for git-svn propset, 2014-12-07) to avoid using "set -e" in the test body. Let's move this into a setup test using "test_expect_success" instead. While I'm at it refactor: * Repeated "mkdir" to "mkdir -p" * Uses of "touch" to creating the files with ">" instead * The "rm -rf" at the end to happen in a "test_when_finished" Signed-off-by: Ævar Arnfjörð Bjarmason <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent 88fce12 commit 4f4d201

File tree

1 file changed

+15
-12
lines changed

1 file changed

+15
-12
lines changed

t/t9148-git-svn-propset.sh

Lines changed: 15 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -7,19 +7,22 @@ test_description='git svn propset tests'
77

88
. ./lib-git-svn.sh
99

10-
foo_subdir2="subdir/subdir2/foo_subdir2"
10+
test_expect_success 'setup propset via import' '
11+
test_when_finished "rm -rf import" &&
1112
12-
set -e
13-
mkdir import &&
14-
(set -e ; cd import
15-
mkdir subdir
16-
mkdir subdir/subdir2
17-
touch foo # for 'add props top level'
18-
touch subdir/foo_subdir # for 'add props relative'
19-
touch "$foo_subdir2" # for 'add props subdir'
20-
svn_cmd import -m 'import for git svn' . "$svnrepo" >/dev/null
21-
)
22-
rm -rf import
13+
foo_subdir2="subdir/subdir2/foo_subdir2" &&
14+
mkdir -p import/subdir/subdir2 &&
15+
(
16+
cd import &&
17+
# for "add props top level"
18+
>foo &&
19+
# for "add props relative"
20+
>subdir/foo_subdir &&
21+
# for "add props subdir"
22+
>"$foo_subdir2" &&
23+
svn_cmd import -m "import for git svn" . "$svnrepo"
24+
)
25+
'
2326

2427
test_expect_success 'initialize git svn' '
2528
git svn init "$svnrepo"

0 commit comments

Comments
 (0)