gitweb: Add git_merge sub
[git/gsoc2010-gitweb.git] / t / t5800-remote-helpers.sh
blob75a0163c074724513accc9f2a482d72d9e51532c
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
11 then
12 say 'skipping git remote-testgit tests: requires Python support'
13 test_done
16 test_expect_success 'setup repository' '
17 git init --bare server/.git &&
18 git clone server public &&
19 (cd public &&
20 echo content >file &&
21 git add file &&
22 git commit -m one &&
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' '
37 (cd public &&
38 echo content >>file &&
39 git commit -a -m two &&
40 git push)
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' '
54 (cd localclone &&
55 echo content >>file &&
56 git commit -a -m three &&
57 git push) &&
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' '
63 (cd clone &&
64 git pull)
67 test_expect_success 'pushing remote local repo' '
68 (cd clone &&
69 echo content >>file &&
70 git commit -a -m four &&
71 git push) &&
72 HEAD=$(git --git-dir=clone/.git rev-parse --verify HEAD) &&
73 test $HEAD = $(git --git-dir=server/.git rev-parse --verify HEAD)
76 test_done