summaryrefslogtreecommitdiff
path: root/t/t5520-pull.sh
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2015-04-23 20:29:14 (GMT)
committerJunio C Hamano <gitster@pobox.com>2015-04-29 20:17:52 (GMT)
commit55691133291560eacaf03003528e007a3534213d (patch)
treeb2f581205c2fdff5f894643a9910b260e545832a /t/t5520-pull.sh
parent00c7e7e7e8a2aa07b2cd3a09c8f9e11872727d86 (diff)
downloadgit-55691133291560eacaf03003528e007a3534213d.zip
git-55691133291560eacaf03003528e007a3534213d.tar.gz
git-55691133291560eacaf03003528e007a3534213d.tar.bz2
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>
Diffstat (limited to 't/t5520-pull.sh')
-rwxr-xr-xt/t5520-pull.sh22
1 files changed, 6 insertions, 16 deletions
diff --git a/t/t5520-pull.sh b/t/t5520-pull.sh
index 227d293..5195a21 100755
--- a/t/t5520-pull.sh
+++ b/t/t5520-pull.sh
@@ -9,36 +9,27 @@ modify () {
mv "$2.x" "$2"
}
-D=`pwd`
-
test_expect_success setup '
-
echo file >file &&
git add file &&
git commit -a -m original
-
'
test_expect_success 'pulling into void' '
- mkdir cloned &&
- cd cloned &&
- git init &&
- git pull ..
-'
-
-cd "$D"
-
-test_expect_success 'checking the results' '
+ git init cloned &&
+ (
+ cd cloned &&
+ git pull ..
+ ) &&
test -f file &&
test -f cloned/file &&
test_cmp file cloned/file
'
test_expect_success 'pulling into void using master:master' '
- mkdir cloned-uho &&
+ git init cloned-uho &&
(
cd cloned-uho &&
- git init &&
git pull .. master:master
) &&
test -f file &&
@@ -71,7 +62,6 @@ test_expect_success 'pulling into void does not overwrite staged files' '
)
'
-
test_expect_success 'pulling into void does not remove new staged files' '
git init cloned-staged-new &&
(