Skip to content

Commit

Permalink
t5520: style fixes
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Junio C Hamano committed Apr 29, 2015
1 parent 00c7e7e commit 5569113
Showing 1 changed file with 6 additions and 16 deletions.
22 changes: 6 additions & 16 deletions t/t5520-pull.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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 &&
Expand Down Expand Up @@ -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 &&
(
Expand Down

0 comments on commit 5569113

Please sign in to comment.