]> git.ipfire.org Git - thirdparty/git.git/blob - t/t5800-remote-helpers.sh
grep -O: Do not pass color sequences as filenames to pager
[thirdparty/git.git] / t / t5800-remote-helpers.sh
1 #!/bin/sh
2 #
3 # Copyright (c) 2010 Sverre Rabbelier
4 #
5
6 test_description='Test remote-helper import and export commands'
7
8 . ./test-lib.sh
9
10 if ! test_have_prereq PYTHON
11 then
12 say 'skipping git remote-testgit tests: requires Python support'
13 test_done
14 fi
15
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)
24 '
25
26 test_expect_success 'cloning from local repo' '
27 git clone "testgit::${PWD}/server" localclone &&
28 test_cmp public/file localclone/file
29 '
30
31 test_expect_success 'cloning from remote repo' '
32 git clone "testgit::file://${PWD}/server" clone &&
33 test_cmp public/file clone/file
34 '
35
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)
41 '
42
43 test_expect_success 'pulling from local repo' '
44 (cd localclone && git pull) &&
45 test_cmp public/file localclone/file
46 '
47
48 test_expect_success 'pulling from remote remote' '
49 (cd clone && git pull) &&
50 test_cmp public/file clone/file
51 '
52
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)
60 '
61
62 test_expect_success 'synch with changes from localclone' '
63 (cd clone &&
64 git pull)
65 '
66
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)
74 '
75
76 test_done