Skip to content

Commit 5569113

Browse files
committed
t5520: style fixes
Fix style funnies in early part of this test script that checks "git pull" into an unborn branch. The primary change is that 'chdir' to a newly created empty test repository is now protected by being done in a subshell to make it more robust without having to chdir back to the original place. Signed-off-by: Junio C Hamano <[email protected]>
1 parent 00c7e7e commit 5569113

File tree

1 file changed

+6
-16
lines changed

1 file changed

+6
-16
lines changed

t/t5520-pull.sh

Lines changed: 6 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -9,36 +9,27 @@ modify () {
99
mv "$2.x" "$2"
1010
}
1111

12-
D=`pwd`
13-
1412
test_expect_success setup '
15-
1613
echo file >file &&
1714
git add file &&
1815
git commit -a -m original
19-
2016
'
2117

2218
test_expect_success 'pulling into void' '
23-
mkdir cloned &&
24-
cd cloned &&
25-
git init &&
26-
git pull ..
27-
'
28-
29-
cd "$D"
30-
31-
test_expect_success 'checking the results' '
19+
git init cloned &&
20+
(
21+
cd cloned &&
22+
git pull ..
23+
) &&
3224
test -f file &&
3325
test -f cloned/file &&
3426
test_cmp file cloned/file
3527
'
3628

3729
test_expect_success 'pulling into void using master:master' '
38-
mkdir cloned-uho &&
30+
git init cloned-uho &&
3931
(
4032
cd cloned-uho &&
41-
git init &&
4233
git pull .. master:master
4334
) &&
4435
test -f file &&
@@ -71,7 +62,6 @@ test_expect_success 'pulling into void does not overwrite staged files' '
7162
)
7263
'
7364

74-
7565
test_expect_success 'pulling into void does not remove new staged files' '
7666
git init cloned-staged-new &&
7767
(

0 commit comments

Comments
 (0)