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 < 0x02040000:
16 # Requires Python 2.4 or newer
17 test_set_prereq PYTHON_24
21 git
--git-dir="$1/.git" rev-parse
--verify $2 >expect
&&
22 git
--git-dir="$3/.git" rev-parse
--verify $4 >actual
&&
23 test_cmp expect actual
26 test_expect_success PYTHON_24
'setup repository' '
27 git init --bare server/.git &&
28 git clone server public &&
33 git push origin master)
36 test_expect_success PYTHON_24
'cloning from local repo' '
37 git clone "testgit::${PWD}/server" localclone &&
38 test_cmp public/file localclone/file
41 test_expect_success PYTHON_24
'cloning from remote repo' '
42 git clone "testgit::file://${PWD}/server" clone &&
43 test_cmp public/file clone/file
46 test_expect_success PYTHON_24
'create new commit on remote' '
48 echo content >>file &&
49 git commit -a -m two &&
53 test_expect_success PYTHON_24
'pulling from local repo' '
54 (cd localclone && git pull) &&
55 test_cmp public/file localclone/file
58 test_expect_success PYTHON_24
'pulling from remote remote' '
59 (cd clone && git pull) &&
60 test_cmp public/file clone/file
63 test_expect_success PYTHON_24
'pushing to local repo' '
65 echo content >>file &&
66 git commit -a -m three &&
68 compare_refs localclone HEAD server HEAD
71 test_expect_success PYTHON_24
'synch with changes from localclone' '
76 test_expect_success PYTHON_24
'pushing remote local repo' '
78 echo content >>file &&
79 git commit -a -m four &&
81 compare_refs clone HEAD server HEAD