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 <gitster@pobox.com>
Junio C Hamano committed
Apr 23, 2015 at 13:29 UTC
55691133291560eacaf03003528e007a3534213d
1 file changed
+6
-16
t/t5520-pull.sh
+6
-16
@@ -9,36 +9,27 @@ modify () {
9
mv "$2.x" "$2"
10
}
11
12
-D=`pwd`
13
-
12
test_expect_success setup '
15
-
13
echo file >file &&
14
git add file &&
15
git commit -a -m original
19
-
16
'
17
18
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
+ ) &&
24
test -f file &&
25
test -f cloned/file &&
26
test_cmp file cloned/file
27
'
28
29
test_expect_success 'pulling into void using master:master' '
38
- mkdir cloned-uho &&
30
+ git init cloned-uho &&
31
(
32
cd cloned-uho &&
41
- git init &&
33
git pull .. master:master
34
) &&
35
test -f file &&
@@ -71,7 +62,6 @@ test_expect_success 'pulling into void does not overwrite staged files' '
62
)
63
'
64
74
-
65
test_expect_success 'pulling into void does not remove new staged files' '
66
git init cloned-staged-new &&
67
(