t7606: Avoid using head as a file name
[git/jnareb-git.git] / t / t5800-remote-helpers.sh
blob637d8e97ac4d220437ac168dcce49dfd33aa7a24
1 #!/bin/sh
3 # Copyright (c) 2010 Sverre Rabbelier
6 test_description='Test remote-helper import and export commands'
8 . ./test-lib.sh
10 if test_have_prereq PYTHON && "$PYTHON_PATH" -c '
11 import sys
12 if sys.hexversion < 0x02040000:
13 sys.exit(1)
15 then
17 else
18 skip_all='skipping git remote-testgit tests: requires Python 2.4 or newer'
19 test_done
22 test_expect_success 'setup repository' '
23 git init --bare server/.git &&
24 git clone server public &&
25 (cd public &&
26 echo content >file &&
27 git add file &&
28 git commit -m one &&
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' '
43 (cd public &&
44 echo content >>file &&
45 git commit -a -m two &&
46 git push)
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' '
60 (cd localclone &&
61 echo content >>file &&
62 git commit -a -m three &&
63 git push) &&
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' '
69 (cd clone &&
70 git pull)
73 test_expect_success 'pushing remote local repo' '
74 (cd clone &&
75 echo content >>file &&
76 git commit -a -m four &&
77 git push) &&
78 HEAD=$(git --git-dir=clone/.git rev-parse --verify HEAD) &&
79 test $HEAD = $(git --git-dir=server/.git rev-parse --verify HEAD)
82 test_done