3 # Copyright (c) 2010 Sverre Rabbelier
6 test_description
='Test remote-helper import and export commands'
10 if ! test_have_prereq PYTHON
12 say
'skipping git remote-testgit tests: requires Python support'
16 test_expect_success
'setup repository' '
17 git init --bare server/.git &&
18 git clone server public &&
23 git push origin master)
26 test_expect_success
'cloning from local repo' '
27 git clone "testgit::${PWD}/server" localclone &&
28 test_cmp public/file localclone/file
31 test_expect_success
'cloning from remote repo' '
32 git clone "testgit::file://${PWD}/server" clone &&
33 test_cmp public/file clone/file
36 test_expect_success
'create new commit on remote' '
38 echo content >>file &&
39 git commit -a -m two &&
43 test_expect_success
'pulling from local repo' '
44 (cd localclone && git pull) &&
45 test_cmp public/file localclone/file
48 test_expect_success
'pulling from remote remote' '
49 (cd clone && git pull) &&
50 test_cmp public/file clone/file
53 test_expect_success
'pushing to local repo' '
55 echo content >>file &&
56 git commit -a -m three &&
58 HEAD=$(git --git-dir=localclone/.git rev-parse --verify HEAD) &&
59 test $HEAD = $(git --git-dir=server/.git rev-parse --verify HEAD)
62 test_expect_success
'synch with changes from localclone' '
67 test_expect_success
'pushing remote local repo' '
69 echo content >>file &&
70 git commit -a -m four &&
72 HEAD=$(git --git-dir=clone/.git rev-parse --verify HEAD) &&
73 test $HEAD = $(git --git-dir=server/.git rev-parse --verify HEAD)