3 # Copyright (c) 2010 Sverre Rabbelier
6 test_description
='Test remote-helper import and export commands'
10 if test_have_prereq PYTHON
&& "$PYTHON_PATH" -c '
12 if sys.hexversion < 0x02050000:
18 say
'skipping git remote-testgit tests: requires Python 2.5 or newer'
22 test_expect_success
'setup repository' '
23 git init --bare server/.git &&
24 git clone server public &&
29 git push origin master)
32 test_expect_success
'cloning from local repo' '
33 git clone "testgit::${PWD}/server" localclone &&
34 test_cmp public/file localclone/file
37 test_expect_success
'cloning from remote repo' '
38 git clone "testgit::file://${PWD}/server" clone &&
39 test_cmp public/file clone/file
42 test_expect_success
'create new commit on remote' '
44 echo content >>file &&
45 git commit -a -m two &&
49 test_expect_success
'pulling from local repo' '
50 (cd localclone && git pull) &&
51 test_cmp public/file localclone/file
54 test_expect_success
'pulling from remote remote' '
55 (cd clone && git pull) &&
56 test_cmp public/file clone/file
59 test_expect_success
'pushing to local repo' '
61 echo content >>file &&
62 git commit -a -m three &&
64 HEAD=$(git --git-dir=localclone/.git rev-parse --verify HEAD) &&
65 test $HEAD = $(git --git-dir=server/.git rev-parse --verify HEAD)
68 test_expect_success
'synch with changes from localclone' '
73 test_expect_success
'pushing remote local repo' '
75 echo content >>file &&
76 git commit -a -m four &&
78 HEAD=$(git --git-dir=clone/.git rev-parse --verify HEAD) &&
79 test $HEAD = $(git --git-dir=server/.git rev-parse --verify HEAD)