tests: subshell indentation stylefix
Format the subshells introduced by the previous patch (Several tests: cd inside subshell instead of around, 2010-09-06) like so: ( cd subdir && ... ) && This is generally easier to read and has the nice side-effect that this patch will show what commands are used in the subshell, making it easier to check for lost environment variables and similar behavior changes. Cc: Jens Lehmann <Jens.Lehmann@web.de> Signed-off-by: Jonathan Nieder <jrnieder@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Jonathan Nieder committed
Sep 6, 2010 at 20:42 UTC
18a826924284339e2b637ab747f196235bee1939
22 files changed
+260
-192
t/t1020-subdirectory.sh
+7
-6
@@ -27,12 +27,13 @@ test_expect_success 'update-index and ls-files' '
27
one) echo pass one ;;
28
*) echo bad one; exit 1 ;;
29
esac &&
30
- (cd dir &&
31
- git update-index --add two &&
32
- case "`git ls-files`" in
33
- two) echo pass two ;;
34
- *) echo bad two; exit 1 ;;
35
- esac
30
+ (
31
+ cd dir &&
32
+ git update-index --add two &&
33
+ case "`git ls-files`" in
34
+ two) echo pass two ;;
35
+ *) echo bad two; exit 1 ;;
36
+ esac
37
) &&
38
case "`git ls-files`" in
39
dir/two"$LF"one) echo pass both ;;
t/t1302-repo-version.sh
+9
-2
@@ -33,8 +33,15 @@ test_expect_success 'gitdir selection on unsupported repo' '
33
34
test_expect_success 'gitdir not required mode' '
35
git apply --stat test.patch &&
36
- (cd test && git apply --stat ../test.patch) &&
37
- (cd test2 && git apply --stat ../test.patch)'
36
+ (
37
+ cd test &&
38
+ git apply --stat ../test.patch
39
+ ) &&
40
+ (
41
+ cd test2 &&
42
+ git apply --stat ../test.patch
43
+ )
44
+'
45
46
test_expect_success 'gitdir required mode on normal repos' '
47
(git apply --check --index test.patch &&
t/t3060-ls-files-with-tree.sh
+6
-6
@@ -53,13 +53,13 @@ test_expect_success setup '
53
git add .
54
'
55
56
-# We have to run from a sub-directory to trigger prune_path
57
-# Then we finally get to run our --with-tree test
58
-
56
test_expect_success 'git -ls-files --with-tree should succeed from subdir' '
60
-
61
- (cd sub && git ls-files --with-tree=HEAD~1 >../output)
62
-
57
+ # We have to run from a sub-directory to trigger prune_path
58
+ # Then we finally get to run our --with-tree test
59
+ (
60
+ cd sub &&
61
+ git ls-files --with-tree=HEAD~1 >../output
62
+ )
63
'
64
65
test_expect_success \
t/t3409-rebase-preserve-merges.sh
+7
-6
@@ -52,12 +52,13 @@ test_expect_success 'setup for merge-preserving rebase' \
52
git commit -m "Add different B" &&
53
54
git clone ./. clone2 &&
55
- (cd clone2 &&
56
- git checkout -b topic origin/topic &&
57
- test_must_fail git merge origin/master &&
58
- echo Resolved > B &&
59
- git add B &&
60
- git commit -m "Merge origin/master into topic"
55
+ (
56
+ cd clone2 &&
57
+ git checkout -b topic origin/topic &&
58
+ test_must_fail git merge origin/master &&
59
+ echo Resolved >B &&
60
+ git add B &&
61
+ git commit -m "Merge origin/master into topic"
62
) &&
63
64
git checkout topic &&
t/t3903-stash.sh
+3
-2
@@ -69,8 +69,9 @@ test_expect_success 'apply stashed changes (including index)' '
69
test_expect_success 'unstashing in a subdirectory' '
70
git reset --hard HEAD &&
71
mkdir subdir &&
72
- (cd subdir &&
73
- git stash apply
72
+ (
73
+ cd subdir &&
74
+ git stash apply
75
)
76
'
77
t/t4041-diff-submodule-option.sh
+4
-3
@@ -85,9 +85,10 @@ EOF
85
"
86
87
commit_file sm1 &&
88
-head3=$(cd sm1 &&
89
-git reset --hard HEAD~2 >/dev/null &&
90
-git rev-parse --verify HEAD | cut -c1-7
88
+head3=$(
89
+ cd sm1 &&
90
+ git reset --hard HEAD~2 >/dev/null &&
91
+ git rev-parse --verify HEAD | cut -c1-7
92
)
93
94
test_expect_success 'modified submodule(backward)' "
t/t5510-fetch.sh
+19
-16
@@ -21,26 +21,29 @@ test_expect_success setup '
21
22
test_expect_success "clone and setup child repos" '
23
git clone . one &&
24
- (cd one &&
25
- echo >file updated by one &&
26
- git commit -a -m "updated by one"
24
+ (
25
+ cd one &&
26
+ echo >file updated by one &&
27
+ git commit -a -m "updated by one"
28
) &&
29
git clone . two &&
29
- (cd two &&
30
- git config branch.master.remote one &&
31
- git config remote.one.url ../one/.git/ &&
32
- git config remote.one.fetch refs/heads/master:refs/heads/one
30
+ (
31
+ cd two &&
32
+ git config branch.master.remote one &&
33
+ git config remote.one.url ../one/.git/ &&
34
+ git config remote.one.fetch refs/heads/master:refs/heads/one
35
) &&
36
git clone . three &&
35
- (cd three &&
36
- git config branch.master.remote two &&
37
- git config branch.master.merge refs/heads/one &&
38
- mkdir -p .git/remotes &&
39
- {
40
- echo "URL: ../two/.git/"
41
- echo "Pull: refs/heads/master:refs/heads/two"
42
- echo "Pull: refs/heads/one:refs/heads/one"
43
- } >.git/remotes/two
37
+ (
38
+ cd three &&
39
+ git config branch.master.remote two &&
40
+ git config branch.master.merge refs/heads/one &&
41
+ mkdir -p .git/remotes &&
42
+ {
43
+ echo "URL: ../two/.git/"
44
+ echo "Pull: refs/heads/master:refs/heads/two"
45
+ echo "Pull: refs/heads/one:refs/heads/one"
46
+ } >.git/remotes/two
47
) &&
48
git clone . bundle &&
49
git clone . seven
t/t6050-replace.sh
+25
-21
@@ -104,16 +104,17 @@ test_expect_success '"git fsck" works' '
104
test_expect_success 'repack, clone and fetch work' '
105
git repack -a -d &&
106
git clone --no-hardlinks . clone_dir &&
107
- (cd clone_dir &&
108
- git show HEAD~5 | grep "A U Thor" &&
109
- git show $HASH2 | grep "A U Thor" &&
110
- git cat-file commit $R &&
111
- git repack -a -d &&
112
- test_must_fail git cat-file commit $R &&
113
- git fetch ../ "refs/replace/*:refs/replace/*" &&
114
- git show HEAD~5 | grep "O Thor" &&
115
- git show $HASH2 | grep "O Thor" &&
116
- git cat-file commit $R
107
+ (
108
+ cd clone_dir &&
109
+ git show HEAD~5 | grep "A U Thor" &&
110
+ git show $HASH2 | grep "A U Thor" &&
111
+ git cat-file commit $R &&
112
+ git repack -a -d &&
113
+ test_must_fail git cat-file commit $R &&
114
+ git fetch ../ "refs/replace/*:refs/replace/*" &&
115
+ git show HEAD~5 | grep "O Thor" &&
116
+ git show $HASH2 | grep "O Thor" &&
117
+ git cat-file commit $R
118
)
119
'
120
@@ -177,9 +178,10 @@ test_expect_success 'create parallel branch without the bug' '
178
179
test_expect_success 'push to cloned repo' '
180
git push cloned $HASH6^:refs/heads/parallel &&
180
- (cd clone_dir &&
181
- git checkout parallel &&
182
- git log --pretty=oneline | grep $PARA2
181
+ (
182
+ cd clone_dir &&
183
+ git checkout parallel &&
184
+ git log --pretty=oneline | grep $PARA2
185
)
186
'
187
@@ -191,19 +193,21 @@ test_expect_success 'push branch with replacement' '
193
git show $HASH6~2 | grep "O Thor" &&
194
git show $PARA3 | grep "O Thor" &&
195
git push cloned $HASH6^:refs/heads/parallel2 &&
194
- (cd clone_dir &&
195
- git checkout parallel2 &&
196
- git log --pretty=oneline | grep $PARA3 &&
197
- git show $PARA3 | grep "A U Thor"
196
+ (
197
+ cd clone_dir &&
198
+ git checkout parallel2 &&
199
+ git log --pretty=oneline | grep $PARA3 &&
200
+ git show $PARA3 | grep "A U Thor"
201
)
202
'
203
204
test_expect_success 'fetch branch with replacement' '
205
git branch tofetch $HASH6 &&
203
- (cd clone_dir &&
204
- git fetch origin refs/heads/tofetch:refs/heads/parallel3
205
- git log --pretty=oneline parallel3 | grep $PARA3
206
- git show $PARA3 | grep "A U Thor"
206
+ (
207
+ cd clone_dir &&
208
+ git fetch origin refs/heads/tofetch:refs/heads/parallel3
209
+ git log --pretty=oneline parallel3 | grep $PARA3
210
+ git show $PARA3 | grep "A U Thor"
211
)
212
'
213
t/t7400-submodule-basic.sh
+6
-5
@@ -413,11 +413,12 @@ test_expect_success 'submodule <invalid-path> warns' '
413
414
test_expect_success 'add submodules without specifying an explicit path' '
415
mkdir repo &&
416
- (cd repo &&
417
- git init &&
418
- echo r >r &&
419
- git add r &&
420
- git commit -m "repo commit 1"
416
+ (
417
+ cd repo &&
418
+ git init &&
419
+ echo r >r &&
420
+ git add r &&
421
+ git commit -m "repo commit 1"
422
) &&
423
git clone --bare repo/ bare.git &&
424
cd addtest &&
t/t7401-submodule-summary.sh
+4
-3
@@ -66,9 +66,10 @@ EOF
66
"
67
68
commit_file sm1 &&
69
-head3=$(cd sm1 &&
70
-git reset --hard HEAD~2 >/dev/null &&
71
-git rev-parse --verify HEAD | cut -c1-7
69
+head3=$(
70
+ cd sm1 &&
71
+ git reset --hard HEAD~2 >/dev/null &&
72
+ git rev-parse --verify HEAD | cut -c1-7
73
)
74
75
test_expect_success 'modified submodule(backward)' "
t/t9100-git-svn-basic.sh
+11
-10
@@ -22,16 +22,17 @@ esac
22
test_expect_success \
23
'initialize git svn' '
24
mkdir import &&
25
- (cd import &&
26
- echo foo > foo &&
27
- ln -s foo foo.link
28
- mkdir -p dir/a/b/c/d/e &&
29
- echo "deep dir" > dir/a/b/c/d/e/file &&
30
- mkdir bar &&
31
- echo "zzz" > bar/zzz &&
32
- echo "#!/bin/sh" > exec.sh &&
33
- chmod +x exec.sh &&
34
- svn_cmd import -m "import for git svn" . "$svnrepo" >/dev/null
25
+ (
26
+ cd import &&
27
+ echo foo >foo &&
28
+ ln -s foo foo.link
29
+ mkdir -p dir/a/b/c/d/e &&
30
+ echo "deep dir" >dir/a/b/c/d/e/file &&
31
+ mkdir bar &&
32
+ echo "zzz" >bar/zzz &&
33
+ echo "#!/bin/sh" >exec.sh &&
34
+ chmod +x exec.sh &&
35
+ svn_cmd import -m "import for git svn" . "$svnrepo" >/dev/null
36
) &&
37
rm -rf import &&
38
git svn init "$svnrepo"'
t/t9101-git-svn-props.sh
+19
-14
@@ -53,8 +53,9 @@ cd ..
53
54
rm -rf import
55
test_expect_success 'checkout working copy from svn' 'svn co "$svnrepo" test_wc'
56
-test_expect_success 'setup some commits to svn' \
57
- '(cd test_wc &&
56
+test_expect_success 'setup some commits to svn' '
57
+ (
58
+ cd test_wc &&
59
echo Greetings >> kw.c &&
60
poke kw.c &&
61
svn_cmd commit -m "Not yet an Id" &&
@@ -64,7 +65,8 @@ test_expect_success 'setup some commits to svn' \
65
svn_cmd propset svn:keywords Id kw.c &&
66
poke kw.c &&
67
svn_cmd commit -m "Propset Id"
67
- )'
68
+ )
69
+'
70
71
test_expect_success 'initialize git svn' 'git svn init "$svnrepo"'
72
test_expect_success 'fetch revisions from svn' 'git svn fetch'
@@ -81,13 +83,15 @@ expect='/* $Id$ */'
83
got="`sed -ne 2p kw.c`"
84
test_expect_success 'raw $Id$ found in kw.c' "test '$expect' = '$got'"
85
84
-test_expect_success "propset CR on crlf files" \
85
- '(cd test_wc &&
86
+test_expect_success "propset CR on crlf files" '
87
+ (
88
+ cd test_wc &&
89
svn_cmd propset svn:eol-style CR empty &&
90
svn_cmd propset svn:eol-style CR crlf &&
91
svn_cmd propset svn:eol-style CR ne_crlf &&
92
svn_cmd commit -m "propset CR on crlf files"
90
- )'
93
+ )
94
+'
95
96
test_expect_success 'fetch and pull latest from svn and checkout a new wc' \
97
'git svn fetch &&
@@ -137,19 +141,20 @@ cat > show-ignore.expect <<\EOF
141
EOF
142
143
test_expect_success 'test show-ignore' "
140
- (cd test_wc &&
141
- mkdir -p deeply/nested/directory &&
142
- touch deeply/nested/directory/.keep &&
143
- svn_cmd add deeply &&
144
- svn_cmd up &&
145
- svn_cmd propset -R svn:ignore '
144
+ (
145
+ cd test_wc &&
146
+ mkdir -p deeply/nested/directory &&
147
+ touch deeply/nested/directory/.keep &&
148
+ svn_cmd add deeply &&
149
+ svn_cmd up &&
150
+ svn_cmd propset -R svn:ignore '
151
no-such-file*
152
' .
148
- svn_cmd commit -m 'propset svn:ignore'
153
+ svn_cmd commit -m 'propset svn:ignore'
154
) &&
155
git svn show-ignore > show-ignore.got &&
156
cmp show-ignore.expect show-ignore.got
152
- "
157
+"
158
159
cat >create-ignore.expect <<\EOF
160
/no-such-file*
t/t9102-git-svn-deep-rmdir.sh
+7
-6
@@ -4,12 +4,13 @@ test_description='git svn rmdir'
4
5
test_expect_success 'initialize repo' '
6
mkdir import &&
7
- (cd import &&
8
- mkdir -p deeply/nested/directory/number/1 &&
9
- mkdir -p deeply/nested/directory/number/2 &&
10
- echo foo > deeply/nested/directory/number/1/file &&
11
- echo foo > deeply/nested/directory/number/2/another &&
12
- svn_cmd import -m "import for git svn" . "$svnrepo"
7
+ (
8
+ cd import &&
9
+ mkdir -p deeply/nested/directory/number/1 &&
10
+ mkdir -p deeply/nested/directory/number/2 &&
11
+ echo foo >deeply/nested/directory/number/1/file &&
12
+ echo foo >deeply/nested/directory/number/2/another &&
13
+ svn_cmd import -m "import for git svn" . "$svnrepo"
14
)
15
'
16
t/t9104-git-svn-follow-parent.sh
+39
-31
@@ -8,21 +8,23 @@ test_description='git svn fetching'
8
9
test_expect_success 'initialize repo' '
10
mkdir import &&
11
- (cd import &&
12
- mkdir -p trunk &&
13
- echo hello > trunk/readme &&
14
- svn_cmd import -m "initial" . "$svnrepo"
11
+ (
12
+ cd import &&
13
+ mkdir -p trunk &&
14
+ echo hello >trunk/readme &&
15
+ svn_cmd import -m "initial" . "$svnrepo"
16
) &&
17
svn_cmd co "$svnrepo" wc &&
17
- (cd wc &&
18
- echo world >> trunk/readme &&
19
- poke trunk/readme &&
20
- svn_cmd commit -m "another commit" &&
21
- svn_cmd up &&
22
- svn_cmd mv trunk thunk &&
23
- echo goodbye >> thunk/readme &&
24
- poke thunk/readme &&
25
- svn_cmd commit -m "bye now"
18
+ (
19
+ cd wc &&
20
+ echo world >>trunk/readme &&
21
+ poke trunk/readme &&
22
+ svn_cmd commit -m "another commit" &&
23
+ svn_cmd up &&
24
+ svn_cmd mv trunk thunk &&
25
+ echo goodbye >>thunk/readme &&
26
+ poke thunk/readme &&
27
+ svn_cmd commit -m "bye now"
28
)
29
'
30
@@ -83,16 +85,17 @@ test_expect_success 'follow larger parent' '
85
'
86
87
test_expect_success 'follow higher-level parent' '
86
- svn mkdir -m "follow higher-level parent" "$svnrepo"/blob &&
87
- svn co "$svnrepo"/blob blob &&
88
- (cd blob &&
89
- echo hi > hi &&
90
- svn add hi &&
88
+ svn mkdir -m "follow higher-level parent" "$svnrepo"/blob &&
89
+ svn co "$svnrepo"/blob blob &&
90
+ (
91
+ cd blob &&
92
+ echo hi > hi &&
93
+ svn add hi &&
94
svn commit -m "hihi"
92
- ) &&
93
- svn mkdir -m "new glob at top level" "$svnrepo"/glob &&
94
- svn mv -m "move blob down a level" "$svnrepo"/blob "$svnrepo"/glob/blob &&
95
- git svn init --minimize-url -i blob "$svnrepo"/glob/blob &&
95
+ ) &&
96
+ svn mkdir -m "new glob at top level" "$svnrepo"/glob &&
97
+ svn mv -m "move blob down a level" "$svnrepo"/blob "$svnrepo"/glob/blob &&
98
+ git svn init --minimize-url -i blob "$svnrepo"/glob/blob &&
99
git svn fetch -i blob
100
'
101
@@ -117,17 +120,22 @@ test_expect_success 'follow-parent avoids deleting relevant info' '
120
import/trunk/subversion/bindings/swig/perl/t/larger-parent &&
121
echo "bad delete test 2" > \
122
import/trunk/subversion/bindings/swig/perl/another-larger &&
120
- (cd import &&
121
- svn import -m "r9270 test" . "$svnrepo"/r9270
123
+ (
124
+ cd import &&
125
+ svn import -m "r9270 test" . "$svnrepo"/r9270
126
) &&
127
svn_cmd co "$svnrepo"/r9270/trunk/subversion/bindings/swig/perl r9270 &&
124
- (cd r9270 &&
125
- svn mkdir native &&
126
- svn mv t native/t &&
127
- for i in a b c; do svn mv $i.pm native/$i.pm; done &&
128
- echo z >> native/t/c.t &&
129
- poke native/t/c.t &&
130
- svn commit -m "reorg test"
128
+ (
129
+ cd r9270 &&
130
+ svn mkdir native &&
131
+ svn mv t native/t &&
132
+ for i in a b c
133
+ do
134
+ svn mv $i.pm native/$i.pm
135
+ done &&
136
+ echo z >>native/t/c.t &&
137
+ poke native/t/c.t &&
138
+ svn commit -m "reorg test"
139
) &&
140
git svn init --minimize-url -i r9270-t \
141
"$svnrepo"/r9270/trunk/subversion/bindings/swig/perl/native/t &&
t/t9105-git-svn-commit-diff.sh
+4
-3
@@ -6,9 +6,10 @@ test_description='git svn commit-diff'
6
7
test_expect_success 'initialize repo' '
8
mkdir import &&
9
- (cd import &&
10
- echo hello > readme &&
11
- svn_cmd import -m "initial" . "$svnrepo"
9
+ (
10
+ cd import &&
11
+ echo hello >readme &&
12
+ svn_cmd import -m "initial" . "$svnrepo"
13
) &&
14
echo hello > readme &&
15
git update-index --add readme &&
t/t9106-git-svn-commit-diff-clobber.sh
+17
-13
@@ -6,9 +6,10 @@ test_description='git svn commit-diff clobber'
6
7
test_expect_success 'initialize repo' '
8
mkdir import &&
9
- (cd import &&
10
- echo initial > file &&
11
- svn_cmd import -m "initial" . "$svnrepo"
9
+ (
10
+ cd import &&
11
+ echo initial >file &&
12
+ svn_cmd import -m "initial" . "$svnrepo"
13
) &&
14
echo initial > file &&
15
git update-index --add file &&
@@ -16,10 +17,11 @@ test_expect_success 'initialize repo' '
17
'
18
test_expect_success 'commit change from svn side' '
19
svn_cmd co "$svnrepo" t.svn &&
19
- (cd t.svn &&
20
- echo second line from svn >> file &&
21
- poke file &&
22
- svn_cmd commit -m "second line from svn"
20
+ (
21
+ cd t.svn &&
22
+ echo second line from svn >>file &&
23
+ poke file &&
24
+ svn_cmd commit -m "second line from svn"
25
) &&
26
rm -rf t.svn
27
'
@@ -44,10 +46,11 @@ test_expect_success 'dcommit fails to commit because of conflict' '
46
git svn fetch &&
47
git reset --hard refs/${remotes_git_svn} &&
48
svn_cmd co "$svnrepo" t.svn &&
47
- (cd t.svn &&
48
- echo fourth line from svn >> file &&
49
- poke file &&
50
- svn_cmd commit -m "fourth line from svn"
49
+ (
50
+ cd t.svn &&
51
+ echo fourth line from svn >>file &&
52
+ poke file &&
53
+ svn_cmd commit -m "fourth line from svn"
54
) &&
55
rm -rf t.svn &&
56
echo "fourth line from git" >> file &&
@@ -68,8 +71,9 @@ test_expect_success 'dcommit does the svn equivalent of an index merge' "
71
72
test_expect_success 'commit another change from svn side' '
73
svn_cmd co "$svnrepo" t.svn &&
71
- (cd t.svn &&
72
- echo third line from svn >> file &&
74
+ (
75
+ cd t.svn &&
76
+ echo third line from svn >>file &&
77
poke file &&
78
svn_cmd commit -m "third line from svn"
79
) &&
t/t9107-git-svn-migrate.sh
+9
-7
@@ -6,14 +6,16 @@ test_description='git svn metadata migrations from previous versions'
6
test_expect_success 'setup old-looking metadata' '
7
cp "$GIT_DIR"/config "$GIT_DIR"/config-old-git-svn &&
8
mkdir import &&
9
- (cd import &&
10
- for i in trunk branches/a branches/b \
11
- tags/0.1 tags/0.2 tags/0.3; do
12
- mkdir -p $i && \
13
- echo hello >> $i/README || exit 1
14
- done && \
9
+ (
10
+ cd import &&
11
+ for i in trunk branches/a branches/b tags/0.1 tags/0.2 tags/0.3
12
+ do
13
+ mkdir -p $i &&
14
+ echo hello >>$i/README ||
15
+ exit 1
16
+ done &&
17
svn_cmd import -m test . "$svnrepo"
16
- ) &&
18
+ ) &&
19
git svn init "$svnrepo" &&
20
git svn fetch &&
21
rm -rf "$GIT_DIR"/svn &&
t/t9114-git-svn-dcommit-merge.sh
+4
-3
@@ -37,11 +37,12 @@ EOF
37
test_expect_success 'setup svn repository' '
38
svn_cmd co "$svnrepo" mysvnwork &&
39
mkdir -p mysvnwork/trunk &&
40
- (cd mysvnwork &&
41
- big_text_block >> trunk/README &&
40
+ (
41
+ cd mysvnwork &&
42
+ big_text_block >>trunk/README &&
43
svn_cmd add trunk &&
44
svn_cmd ci -m "first commit" trunk
44
- )
45
+ )
46
'
47
48
test_expect_success 'setup git mirror and merge' '
t/t9115-git-svn-dcommit-funky-renames.sh
+4
-3
@@ -61,11 +61,12 @@ test_expect_success 'add a file with plus signs' '
61
62
test_expect_success 'clone the repository to test rebase' '
63
git svn clone "$svnrepo" test-rebase &&
64
- (cd test-rebase &&
65
- echo test-rebase > test-rebase &&
64
+ (
65
+ cd test-rebase &&
66
+ echo test-rebase >test-rebase &&
67
git add test-rebase &&
68
git commit -m test-rebase
68
- )
69
+ )
70
'
71
72
test_expect_success 'make a commit to test rebase' '
t/t9116-git-svn-log.sh
+9
-7
@@ -8,14 +8,16 @@ test_description='git svn log tests'
8
9
test_expect_success 'setup repository and import' '
10
mkdir import &&
11
- (cd import &&
12
- for i in trunk branches/a branches/b \
13
- tags/0.1 tags/0.2 tags/0.3; do
14
- mkdir -p $i && \
15
- echo hello >> $i/README || exit 1
16
- done && \
11
+ (
12
+ cd import &&
13
+ for i in trunk branches/a branches/b tags/0.1 tags/0.2 tags/0.3
14
+ do
15
+ mkdir -p $i &&
16
+ echo hello >>$i/README ||
17
+ exit 1
18
+ done &&
19
svn_cmd import -m test . "$svnrepo"
18
- ) &&
20
+ ) &&
21
git svn init "$svnrepo" -T trunk -b branches -t tags &&
22
git svn fetch &&
23
git reset --hard trunk &&
t/t9119-git-svn-info.sh
+45
-24
@@ -39,9 +39,10 @@ quoted_svnrepo="$(echo $svnrepo | sed 's/ /%20/')"
39
40
test_expect_success 'setup repository and import' '
41
mkdir info &&
42
- (cd info &&
43
- echo FIRST > A &&
44
- echo one > file &&
42
+ (
43
+ cd info &&
44
+ echo FIRST >A &&
45
+ echo one >file &&
46
ln -s file symlink-file &&
47
mkdir directory &&
48
touch directory/.placeholder &&
@@ -49,14 +50,16 @@ test_expect_success 'setup repository and import' '
50
svn_cmd import -m "initial" . "$svnrepo"
51
) &&
52
svn_cmd co "$svnrepo" svnwc &&
52
- (cd svnwc &&
53
- echo foo > foo &&
53
+ (
54
+ cd svnwc &&
55
+ echo foo >foo &&
56
svn_cmd add foo &&
57
svn_cmd commit -m "change outside directory" &&
58
svn_cmd update
59
) &&
60
mkdir gitwc &&
59
- (cd gitwc &&
61
+ (
62
+ cd gitwc &&
63
git svn init "$svnrepo" &&
64
git svn fetch
65
) &&
@@ -138,12 +141,14 @@ test_expect_success 'info --url symlink-directory' '
141
142
test_expect_success 'info added-file' "
143
echo two > gitwc/added-file &&
141
- (cd gitwc &&
144
+ (
145
+ cd gitwc &&
146
git add added-file
147
) &&
148
cp gitwc/added-file svnwc/added-file &&
149
ptouch gitwc/added-file svnwc/added-file &&
146
- (cd svnwc &&
150
+ (
151
+ cd svnwc &&
152
svn_cmd add added-file > /dev/null
153
) &&
154
(cd svnwc; svn info added-file) > expected.info-added-file &&
@@ -160,10 +165,12 @@ test_expect_success 'info added-directory' "
165
mkdir gitwc/added-directory svnwc/added-directory &&
166
ptouch gitwc/added-directory svnwc/added-directory &&
167
touch gitwc/added-directory/.placeholder &&
163
- (cd svnwc &&
168
+ (
169
+ cd svnwc &&
170
svn_cmd add added-directory > /dev/null
171
) &&
166
- (cd gitwc &&
172
+ (
173
+ cd gitwc &&
174
git add added-directory
175
) &&
176
(cd svnwc; svn info added-directory) \
@@ -179,11 +186,13 @@ test_expect_success 'info --url added-directory' '
186
'
187
188
test_expect_success 'info added-symlink-file' "
182
- (cd gitwc &&
189
+ (
190
+ cd gitwc &&
191
ln -s added-file added-symlink-file &&
192
git add added-symlink-file
193
) &&
186
- (cd svnwc &&
194
+ (
195
+ cd svnwc &&
196
ln -s added-file added-symlink-file &&
197
svn_cmd add added-symlink-file > /dev/null
198
) &&
@@ -202,11 +211,13 @@ test_expect_success 'info --url added-symlink-file' '
211
'
212
213
test_expect_success 'info added-symlink-directory' "
205
- (cd gitwc &&
214
+ (
215
+ cd gitwc &&
216
ln -s added-directory added-symlink-directory &&
217
git add added-symlink-directory
218
) &&
209
- (cd svnwc &&
219
+ (
220
+ cd svnwc &&
221
ln -s added-directory added-symlink-directory &&
222
svn_cmd add added-symlink-directory > /dev/null
223
) &&
@@ -230,10 +241,12 @@ test_expect_success 'info --url added-symlink-directory' '
241
# simply reuses the Last Changed Date.
242
243
test_expect_success 'info deleted-file' "
233
- (cd gitwc &&
244
+ (
245
+ cd gitwc &&
246
git rm -f file > /dev/null
247
) &&
236
- (cd svnwc &&
248
+ (
249
+ cd svnwc &&
250
svn_cmd rm --force file > /dev/null
251
) &&
252
(cd svnwc; svn info file) |
@@ -251,10 +264,12 @@ test_expect_success 'info --url file (deleted)' '
264
'
265
266
test_expect_success 'info deleted-directory' "
254
- (cd gitwc &&
267
+ (
268
+ cd gitwc &&
269
git rm -r -f directory > /dev/null
270
) &&
257
- (cd svnwc &&
271
+ (
272
+ cd svnwc &&
273
svn_cmd rm --force directory > /dev/null
274
) &&
275
(cd svnwc; svn info directory) |
@@ -272,10 +287,12 @@ test_expect_success 'info --url directory (deleted)' '
287
'
288
289
test_expect_success 'info deleted-symlink-file' "
275
- (cd gitwc &&
290
+ (
291
+ cd gitwc &&
292
git rm -f symlink-file > /dev/null
293
) &&
278
- (cd svnwc &&
294
+ (
295
+ cd svnwc &&
296
svn_cmd rm --force symlink-file > /dev/null
297
) &&
298
(cd svnwc; svn info symlink-file) |
@@ -294,10 +311,12 @@ test_expect_success 'info --url symlink-file (deleted)' '
311
'
312
313
test_expect_success 'info deleted-symlink-directory' "
297
- (cd gitwc &&
314
+ (
315
+ cd gitwc &&
316
git rm -f symlink-directory > /dev/null
317
) &&
300
- (cd svnwc &&
318
+ (
319
+ cd svnwc &&
320
svn_cmd rm --force symlink-directory > /dev/null
321
) &&
322
(cd svnwc; svn info symlink-directory) |
@@ -346,7 +365,8 @@ test_expect_success 'info --url unknown-directory' '
365
'
366
367
test_expect_success 'info unknown-symlink-file' "
349
- (cd gitwc &&
368
+ (
369
+ cd gitwc &&
370
ln -s unknown-file unknown-symlink-file
371
) &&
372
(cd gitwc; test_must_fail git svn info unknown-symlink-file) \
@@ -361,7 +381,8 @@ test_expect_success 'info --url unknown-symlink-file' '
381
'
382
383
test_expect_success 'info unknown-symlink-directory' "
364
- (cd gitwc &&
384
+ (
385
+ cd gitwc &&
386
ln -s unknown-directory unknown-symlink-directory
387
) &&
388
(cd gitwc; test_must_fail git svn info unknown-symlink-directory) \
t/t9120-git-svn-clone-with-percent-escapes.sh
+2
-1
@@ -20,7 +20,8 @@ test_expect_success 'setup svnrepo' '
20
21
test_expect_success 'test clone with percent escapes' '
22
git svn clone "$svnrepo/pr%20ject" clone &&
23
- (cd clone &&
23
+ (
24
+ cd clone &&
25
git rev-parse refs/${remotes_git_svn}
26
)
27
'