3 # Copyright (c) 2010 Sverre Rabbelier
6 test_description
='Test remote-helper import and export commands'
10 test_expect_success
'setup repository' '
11 git init --bare server/.git &&
12 git clone server public &&
17 git push origin master)
20 test_expect_success
'cloning from local repo' '
21 git clone "testgit::${PWD}/server" localclone &&
22 test_cmp public/file localclone/file
25 test_expect_success
'cloning from remote repo' '
26 git clone "testgit::file://${PWD}/server" clone &&
27 test_cmp public/file clone/file
30 test_expect_success
'create new commit on remote' '
32 echo content >>file &&
33 git commit -a -m two &&
37 test_expect_success
'pulling from local repo' '
38 (cd localclone && git pull) &&
39 test_cmp public/file localclone/file
42 test_expect_success
'pulling from remote remote' '
43 (cd clone && git pull) &&
44 test_cmp public/file clone/file
47 test_expect_success
'pushing to local repo' '
49 echo content >>file &&
50 git commit -a -m three &&
52 HEAD=$(git --git-dir=localclone/.git rev-parse --verify HEAD) &&
53 test $HEAD = $(git --git-dir=server/.git rev-parse --verify HEAD)
56 test_expect_success
'synch with changes from localclone' '
61 test_expect_success
'pushing remote local repo' '
63 echo content >>file &&
64 git commit -a -m four &&
66 HEAD=$(git --git-dir=clone/.git rev-parse --verify HEAD) &&
67 test $HEAD = $(git --git-dir=server/.git rev-parse --verify HEAD)