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
20 test_expect_success PYTHON_24
'setup repository' '
21 git init --bare server/.git &&
22 git clone server public &&
27 git push origin master)
30 test_expect_success PYTHON_24
'cloning from local repo' '
31 git clone "testgit::${PWD}/server" localclone &&
32 test_cmp public/file localclone/file
35 test_expect_success PYTHON_24
'cloning from remote repo' '
36 git clone "testgit::file://${PWD}/server" clone &&
37 test_cmp public/file clone/file
40 test_expect_success PYTHON_24
'create new commit on remote' '
42 echo content >>file &&
43 git commit -a -m two &&
47 test_expect_success PYTHON_24
'pulling from local repo' '
48 (cd localclone && git pull) &&
49 test_cmp public/file localclone/file
52 test_expect_success PYTHON_24
'pulling from remote remote' '
53 (cd clone && git pull) &&
54 test_cmp public/file clone/file
57 test_expect_success PYTHON_24
'pushing to local repo' '
59 echo content >>file &&
60 git commit -a -m three &&
62 HEAD=$(git --git-dir=localclone/.git rev-parse --verify HEAD) &&
63 test $HEAD = $(git --git-dir=server/.git rev-parse --verify HEAD)
66 test_expect_success PYTHON_24
'synch with changes from localclone' '
71 test_expect_success PYTHON_24
'pushing remote local repo' '
73 echo content >>file &&
74 git commit -a -m four &&
76 HEAD=$(git --git-dir=clone/.git rev-parse --verify HEAD) &&
77 test $HEAD = $(git --git-dir=server/.git rev-parse --verify HEAD)